Skip to main content
Skip table of contents

Manual Creation of Heap Dumps

There a multiple tools and ways to create a heap dump of a running java application manuall. In the following, the creation with the Java Development Kit tools JMAP and JCMD is presented as well as the creation with the GUI tool VisualVM.

Prerequisites

The X4 Server generally runs via a Java JDK process.

The PID of the process is required to create a heap dump for this process. Proceed as follows:

  1. Start the Windows Task-Manager.

  2. Configure the Windows Task-Manager, so that the PID and the command line are shown as columns. To do this, right-click in the header line of the table and activate PID and command line:

    image-20240528-134038.png

  3. Now you can read out the PID:

    image-20240528-134155.png

Java Development Kit Tools

The JDK offers several tools for creating a heap dump. These tools are command line-based.

Possible tools are JMAP and JCMD.
You will find the tools in the following folder in the JDK that is supplied with the server:

CODE
<X4-Installation>\Server\jdk\bin

JMAP

  1. Execute the following command in the <server_directory>/jdk/bin folder in a command line interface (CLI):

CODE
jmap -dump:live,format=b,file=/path/to/heapdump.hprof <pid>
  1. Replace the PID with the PID of the X4 Server that you have previously read out with the Windows Task Manager.

  2. In /path/to/heapdump enter the path where you want to save the heap dump.

The path must already exist.

We recommend using an absolute path.

JCMD

  1. Execute the following command in the <server_directory>/jdk/bin folder in a command line interface (CLI):

    CODE
    jcmd <pid> GC.heap_dump /path/to/heapdump.hprof
  2. Replace the PID with the PID of the X4 Server that you have previously read out with the Windows Task Manager.

  3. In /path/to/heapdump enter the path where you want to save the heap dump.

The path must already exist.

We recommend using an absolute path.

Creating Heap Dumps with a GUI Tool

There are several GUI tools for creating heap dumps. We use VisualVM in the following.

Note: Using VisualVM to create a heap dump from an X4 server installed as a service may cause access rights issues if the service is running under a different user than the user running VisualVM.

In the following, we will show you how you can use a VisualVM to create heap dumps.

  1. Download the VisualVM: https://visualvm.github.io/download.html

  2. Start the visualvm.exe file in the bin folder of the downlaod.

  3. Search for the PID in the list of processes:

    image-20240528-142933.png

  4. Double-click on the process from which you want to receive the heap dump.

  5. Open the Monitor tab.

  6. Click on the Heap Dump button to open a heap dump.

  7. Save the heap dump by searching for it in the process list on the right-hand side and saving it with the right mouse button:

    image-20240528-143748.png

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.