server dump command

Creates a snapshot of a server and saves the result into an archive file for further tuning and diagnosis.

Useful for problem diagnosis of an Open Liberty server because the result file contains server configuration, log information, and details of the deployed applications in the work area directory. The command can be applied to either a running or a stopped server.

For a running server, the following information is also included:

  • State of each OSGi bundle in the server

  • Wiring information for each OSGi bundle in the server

  • Component list that is managed by the Service Component Runtime (SCR) environment

  • Detailed information of each component from SCR

  • Configuration administration data of each OSGi bundle

  • Information about registered OSGi services

  • Runtime environment settings such as Java virtual machine (JVM), heap size, operating system, thread information, and network status

Usage examples

Create a dump file of thread information from the myserver server in a ZIP archive called myserver.zip:

server dump myserver --archive="myserver.zip" --include=thread

Create a snapshot of the myserver server status in a ZIP archive called myserver.zip:

server dump myserver --archive=myserver.zip --include=heap

Syntax

Run the command from the path_to_liberty/bin directory.

server dump serverName [options]
serverName

The name of the server to run the command against. If no server is specified, a server called defaultServer is automatically created to run the command against.

options

One or more optional parameters.

Options

Option Description

--archive="path_to_the_target_archive_file"

Specifies a target file for the package or dump operation. This path can be either a relative path, which is relative to the installation root directory of Open Liberty, or an absolute path. The default archive target is a compressed file with the server name, which is stored in the installation root directory. Use quotation marks if the value contains spaces. You can use this option for both package and dump operations.

If you specify a .jar extension for your archive file name, the server command creates a new self-extracting archive file from which the Open Liberty server can be installed by using the java command.

--include=diagnose_option,diagnose_option,…​

Specifies the type of diagnostic information to be captured. The value of --include is a comma-delimited list, which can contain one or more of the following values:

  • heap is used to help diagnose excessive memory consumption and memory leaks. The dump shows live objects in the memory and references between them. On IBM J9 virtual machines, the resulting file is named heapdump.date.time.processID.sequenceNumber.phd. On HotSpot virtual machines, the resulting file is named java.date.time.processID.sequenceNumber.hprof.

  • system is also used to help diagnose excessive memory consumption and memory leaks, but a system dump also helps find defects in the virtual machine. System dumps are only supported on IBM J9 virtual machines. The resulting file is named core.date.time.processID.sequenceNumber.dmp.

  • thread is used to help diagnose hung threads and deadlocks. Thread dumps can sometimes be used to diagnose excessive CPU issues. On IBM J9 virtual machines, the resulting file is named javacore.date.time.processID.sequenceNumber.txt. On HotSpot virtual machines, the resulting file is named javadump.date.time.processID.sequenceNumber.txt.

The thread dump type is supported only when the server is running on the Java SDK. If the server is started with a JRE, an error is reported indicating that the server does not support the dump type. This restriction applies to HotSpot virtual machines only; the thread Java dump type is supported on any IBM JVM (JRE or SDK).

Exit codes

The following exit codes are available for the server dump command and the equivalent executable JAR file ws-server.jar:

0

OK. 0 indicates successful completion of the requested operation.

1

1 indicates that the JVM options that were used are not valid.

2

2 indicates that the server does not exist.

>=20

Exit codes 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.