Java Heap Dump Process
Posted by Aly Essa, Last modified by Aly Essa on 09 November 2018 10:41 AM

Overview

Every FileCatalyst application that runs, whether it is a service or in stand-alone mode has a Process ID (PID) associated with it when it launches.

A Heap Dump is a snapshot of the memory of a Java Process. The snapshot contains information about the Java objects and classes in the heap at the moment the snapshot is triggered. Our developers can use this information to analyze the root cause of failures.

This article will explore a command line method which can be used on Linux, Windows, and MAC OSX Environments. There are two PDF documents attached which will explore alternative methods with a GUI. If the primary method using the jmap command do not produce results please use the method listed in the respective PDF.

The JMAP application which is shipped with the Java Development Kit (JDK) is no available through standard Java RE installations and a Java JDK is required to collect a Heap Dump. The Java Development Kit installer is available through Java's Download Portal: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Environment

FileCatalyst Direct Suite.

Java Development Kit v7.0 and v8.0.

Resolution

  1. Verify Java Version

    1. Open a Command Prompt or Terminal Window.
    2. Run the following command:

      java -version

      The output should return:


      java version "1.8.0_91"
      Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
      Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
    3. If the Java version information is not displayed properly, you will need to re-install the Java JDK.

  2. Process ID of the FileCatalyst Application

    1. Windows:
      1. Open the Task Manager application.
      2. Under the Details tab locate the java.exe process and look for the PID.

    2. MacOSX (using UI):
      1. Open the Activity Monitor application.
      2. Under the Process Name column locate your FileCatalyst Application. In the corresponding row, the Process ID (PID) will be shown.

    3. Linux and MacOSX (command line method):
      1. Open the command prompt.
      2. Run the following command:

        ps -ax | grep FileCatalyst

        This command will output a list of applications running with their PID. Here is an example of MAC OSX output:

        0      71        1         0 Mon10am       89:16.73 /Applications/FileCatalystServer.app/Contents/MacOS/FileCatalystServer -service
        0      101      1         0 Mon10am       46:11.65 /Applications/FileCatalystHotFolder.app/Contents/MacOS/FileCatalystHotFolder -service
        503  14625   1         0 1:53pm         0:42.27 /Applications/FileCatalystHotFolderAdmin.app/Contents/MacOS/FileCatalystHotFolderAdmin
        503  14636   1         0 1:53pm         0:54.89 /Applications/FileCatalystServerAdmin.app/Contents/MacOS/FileCatalystServerAdmin

        In this list, the second column references the PID and the FileCatalyst Server Service has a PID of 71.

  3. Capturing a Heap Dump

    For this section we will use the Process ID of the FileCatalyst Server Service in step 2c), which was observed as 71.

    1. From the command line run the following command to process the Heap Dump:

      Windows and Linux Command:
      jmap -dump:format=b,file=<storage_path>/filecatalyst-application.hprof <PID>

      Mac OSX Command:
      jmap -J-d64 -dump:format=b,file=<storage_path>/filecatalyst-application.hprof <PID>

      Using the Process ID from the example above, the command would look like:

      jmap -dump:format=b,file=/heapdump-storage/filecatalyst-server-heapdump.hprof 71

    2. The parameter file=/heapdump-storage/filecatalyst-server-heapdump.hprof, will indicate where the Heap Dump will be stored.

Note

  • At the bottom of this article, there are two PDF's that are available for the Heap Dump Process in a Windows and Linux Environment.


Attachments 
 
 Heap Dump Process for Linux.pdf (536.43 KB)
 Heap Dump Process for Windows.pdf (364.84 KB)

Comments (0)