jvmps - Java Virtual Machine Process Status Tool

SYNOPSIS

jvmps [ options ] [ hostid ]
options
Command-line options.
hostid
A string representing the Host Identifier of the host for which the process report should be generated. The string may include optional components that indicate the communications protocol, port number, and other implementation specific data.

DESCRIPTION

The jvmps tool lists the instrumented HotSpot Java Virtual Machines on the target system. The tool is limited to reporting information on Java Virtual Machines for which it has the appropriate access permissions.

If jvmps is run without specifying a hostid, it will look for instrumented Java Virtual Machines on the local host. If started with a hostid, it will look for Java Virtual Machines on the indicated host, using the specified protocol and port. A perfagent process is assumed to be running on the target host.

The jvmps command will report the local VM identifier, or lvmid, for each instrumented Java Virtual Machine found on the target system. The lvmid is typically, but not necessarily, the operating system's process identifier for the Java Virtual Machine process. With no options, jvmps will list each Java application's lvmid followed by the short form of the application's class name or jar file name. The short form of the class name or jar file name omits the classes package information or the jar files path information.

The jvmps command relies on cooperation with the java launcher to find the class name and arguments passed to the main method. If the target Java Virtual Machine is started with a custom launcher, the class name (or jar file name) and the arguments to the main method will not be available. In this case, the jvmps command will output the string -- unknown -- for the class name or java file name.

The list of Java Virtual Machines produced by the jvmps command may be limited by the permissions granted to the principle running the command. The command will only list the Java Virtual Machines for which the principle has appropriate access rights as determined by operating system specific access control mechanisms.

OPTIONS

The jvmps command supports a number of options that modify the output of the command. These options are not committed and are subject to change or removal in the future.
-q
Suppress the output of the class name, jar file name, and arguments passed to the main method, producing only a list of local VM identifiers.

-m
Output the arguments passed to the main method. The output may be null for embedded Java Virtual Machines.

-l
Output the full package name for the application's main class or the full path name to the application's jar file.

-v
Output the arguments passed to the Java Virtual Machine.

-V
Output the arguments passed to the Java Virtual Machine through the flags file (the .hotspotrc file or the file specified by the -XX:Flags=<filename> argument).

OUTPUT FORMAT

The output of the jvmps command follows the following pattern:
lvmid [ [ classname | jarfilename | "-- unknown --"] [ arg* ] [ jvmarg* ] ]

Where all output tokens are separated by white space. An arg that includes embedded white space will introduce ambiguity when attempting to map arguments to their actual positional parameters.

The output format of the jvmps command is not committed. Further revision of the output and the command line options is expected. Scripts written to parse the output of this command should expect to change as this command evolves.

EXAMPLES

This section gives examples on how to use the jvmps command. Note:

Listing the instrumented Java Virtual Machines on the local host

% jvmps
18027 Java2Demo.jar
18032 jvmps.jar
18005 perfagent.jar

Listing the instrumented Java Virtual Machines on a remote host

This example assumes that the perfagent and either the perfagent's internal RMI registry or a separate external rmiregistry process are running on the remote host on the default port (port 1099). It also assumes that the local host has appropriate permissions to access the remote host. This example also includes the -l option to output the long form of the class names or jar file names.

% jvmps -l remote.domain
3002 /opt/j2sdk1.4.1/demo/jfc/Java2D/Java2Demo.jar
2857 /usr/local/jvmstat/classes/perfagent.jar

Listing the instrumented Java Virtual Machines on a remote host with a non-default port for the RMI registry

This example assumes that the perfagent with an internal RMI registry bound to port 2002 is running on the remote host. This example also uses the -m option to include the arguments passed to the main method of each of the listed Java applications.

% jvmps -m remote.domain:2002
3002 /opt/j2sdk1.4.1/demo/jfc/Java2D/Java2Demo.jar
3102 /usr/local/jvmstat/classes/perfagent.jar -p 2002

SEE ALSO


Copyright © 2003 Sun Microsystems, Inc. All Rights Reserved.

Sun
Java Software