server javadump command
The server javadump
command creates a snapshot of the JVM status of a server and saves the result into an archive file for further tuning and diagnosis.
The command is useful for diagnosing problems at the JVM level, such as hung threads, deadlocks, excessive processing, excessive memory consumption, memory leaks, and defects in the virtual machine. The server must be running for the command to capture results.
Each dump type creates a file, but not all dump types are supported by all virtual machines. The default directory for dump files is ${server.output.dir}
. To set a different default directory, you must use an IBM JVM and set the following environment variables:
${IBM_HEAPDUMPDIR}
${IBM_COREDIR}
${IBM_JAVACOREDIR}
The resulting file is created by using UTF-8 encoding for entry names, so the tool that you use to open the file must be able to use UTF-8 encoding for entry names. The jar
command in a Java SDK uses this format.
Usage examples
Capture the JVM status of the myserver
server:
server javadump myserver
Capture the JVM status of the myserver
server and add a heap dump:
server javadump myserver --include=heap
Capture the JVM status of the myserver
server and add heap and system dumps:
server javadump myserver --include=heap,system
Syntax
Run the command from the path_to_liberty/wlp/bin
directory.
server javadump serverName [options]
- serverName
The name of the server to diagnose. If the named server is not running or does not exist, the command fails. If no server name is specified, the command uses
defaultServer
.
Option
Option | Description |
---|---|
--include=diagnose_option,diagnose_option,… | Specifies the type of diagnostic information to capture. The value of
|
Exit codes
The following exit codes are available for the server javadump
command and the equivalent executable JAR file ws-server.jar
:
Code | Explanation |
---|---|
0 | This code indicates successful completion of the requested operation. |
1 | This code indicates invocation of a redundant operation. For example, starting a started server or stopping a stopped server. This code might also be returned by JVM if invalid Java options are used. |
4 | This code indicates that an unsupported action was called on a stopped server. For example, the server is not running when the dump action is called. |
>=20 | Exit codes that are greater than or equal to 20 indicate that an error occurred while performing the request. Messages are printed and captured in log files with more information about the error. |