Java Tool Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 5.11

'jps' - JVM Process Status Tool

This section describes the JVM process status tool, 'jps' for listing JVM processes on local and remote machines.

"jps": A new Java tool that lists all JVM processes on the local machine or a remote machine. "jps" tool is distributed as part of the Sun JDK package and represented by the \Progra~1\java\jdk1.6.0_02\bin\jps.exe program file. "jps" can be executed with the following syntax:

jps [options] [hostid]

where "options" is a list of options and "hostid" is the host identifier of a remote machine.

"jps" options are listed below:

  • -l Output the full package name for the application's main class or the full path name to the application's JAR file.
  • -m Output the arguments passed to the main method. The output may be null for embedded JVMs.
  • -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.
  • -v Output the arguments passed to the JVM.
  • -Joption Pass option to the java launcher called by jps. For example, -J-Xms48m sets the startup memory to 48 megabytes. It is a common convention for -J to pass options to the underlying VM executing applications written in Java.

You don't need to use the "hostid" command argument, if you want to list JVM processes on the local machine. But to list JVM processes on a remote, you need to use "hostid" to specify how to connect to the remove machine. The "hostid" is a string with the following syntax:

[protocol:][[//]hostname][:port][/servername]

protocol
    The communications protocol. The default protocol is "rmi".

hostname
    A hostname or IP address indicating the remote host.
    
port
    The default port for communicating with the remote server. 
    The default port is the RMI registry port (1099).
    
servername
    The treatment of this parameter depends on the implementation. 
    For the "rmi" protocol, this parameter is a string representing 
    the name of the  RMI remote object on the remote host.  

See sections below for tutorial examples on how to use "jps" to list JVM processes on the local or a remote machine.

Sections in This Chapter

'jps' - JVM Process Status Tool

Listing JVM Processes on the Local Machine with "jps"

'jstatd' - JVM Remote Monitoring Server

Starting 'jstatd' with a Security Policy File

Connecting to 'jps' to Remote 'jstatd'

'jstat' Command Options and Parameters

Garbage Collection Testing Program

'jstat -gcutil' - Garbage Collection Statistics

Accessing Remote JVM Processes with 'jstat'

Dr. Herong Yang, updated in 2008
'jps' - JVM Process Status Tool