How to generate javacores, heapdumps and system cores for the WebSphere Application Server V8.5 Liberty profile

Technote (FAQ)


Question

This technote explains how to generate javacores, heapdumps, and system core files which can be used to troubleshoot problems such as hangs, out of memory errors (OOM), and crashes on the WebSphere Application Server V8.5 Liberty profile.

Answer

The initial steps required to configure the Liberty profile to generate javacores, heapdumps, and/or system cores are the same on Windows and UNIX platforms . However, Windows and UNIX systems differ in the way the signal is sent to the process, which in turn triggers the requested dump.



Configuring Windows and Unix platforms with the correct dump agents (for the IBM Java SDK only)
  1. Edit or create the following file:

    <wlp.install.directory>/usr/servers/<serverName>/jvm.options

    Note: Refer to Setting generic JVM arguments in the Liberty profile for more details.

  2. Add one or more of the following JVM options to create the desired dumps. Examples below:
    • To generate heapdumps:

      -Xdump:heap:events=user

    • To generate system cores:

      -Xdump:system:events=user

    • To generate javacores, heapdumps and system cores

      -Xdump:java+heap+system:events=user

      Refer to the -Xdump documentation for more details.

  3. Start the server using the following command in order for the -Xdump options to take effect:

    <wlp.install.directory>/bin/server start <serverName>

  4. Reproduce the problem on the target server.

  5. Then use the following procedure to send a signal to the Java process in order to trigger the desired dump.
    • For Windows platforms, issue Ctrl + Break from the same command prompt window used to start the Liberty profile server. The location of the dump will be displayed on the command line and can be found under the following directory:

      <wlp.install.directory>/usr/servers/<serverName>

    • For UNIX platforms, issue the following command:

      kill -3 <PID>

      Where <PID> is the process ID of the Liberty Profile Server experiencing the problem.

Notes:
  • Dump files will be located under the following directory:

    <wlp.install.directory>/usr/servers/<serverName>

  • System dumps (cores) will need to processed with the jextract command prior to submitting them to IBM for analysis. Refer to the jextract documentation for details.




Generating threaddumps, heapdumps, and system cores on Windows and Linux platforms when using the Oracle JDK with the Liberty profile (for the Oracle JDK only)

For Windows platforms:
  • To generate threaddumps, issue Ctrl + Break from the same command prompt window used to start the Liberty profile server. The threaddump will be written to the following file:

    <wlp.install.directory>/usr/servers/<serverName>/logs/console.log

  • To generate heapdumps in the event of an OutOfMemoryError, add the following to the jvm.options file:

    -XX:+HeapDumpOnOutOfMemoryError

    Heapdumps can be taken on demand from the new improved jmap tool which uses the built-in heapdumper code. To manually create a heapdump, run the following jmap commands from the following directory:

    <JAVA_HOME>/bin/jmap.exe

    To connect to the running process and print a histogram of the Java object heap:

    jmap -histo <PID>

    To connect to the running process and dump the Java heap:

    jmap -dump:live,format=b,file=<heapdump_filename> < PID>

  • To generate system cores, use the Windows Task Manager as described below:

    For Windows Vista / Windows 2008 / Windows 7 / Windows 2008 R2

    Note: Since this procedure does not ensure that the JVM will stop all threads, there is a small possibility that the dumps will be missing data, such as thread stacks.
    1. Open up the Windows Task Manager.

    2. Right-click on the process and select Create Dump File.

    3. Wait a moment while the dump is generated. A pop-up will be displayed with the location.



    4. Rename this dump file with a unique identifier (timestamp, count number, and so on) so if you take subsequent dumps, it will not be overwritten.

    5. Process the core dump(s) with jextract.

For Linux platforms:
  • To generate threaddumps, issue the following command:

    kill -3 <PID>

    Where <PID> is the process ID of the Liberty profile server experiencing the problem. The threaddump will be written to the following directory:

    <wlp.install.directory>/usr/servers/<serverName>/logs/console.log file.

  • To generate heapdumps, use the same jmap commands as described in the Windows platforms "To generate heapdumps" section.

  • To generate system cores, issue the following command:

    kill -11 <PID>

    IMPORTANT NOTE: This will exit the Java process!

Notes:
  • Dump files will be located under the following directory:

    <wlp.install.directory>/usr/servers/<serverName>

  • System dumps (cores) will need to processed with the jextract command prior to submitting them to IBM for analysis. Refer to the jextract documentation for details.

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

WebSphere Application Server
General

Software version:

8.5

Operating system(s):

AIX, HP-UX, Linux, Solaris, Windows

Reference #:

1597830

Modified date:

2012-06-15

Translate my page

Machine Translation

Content navigation