KBEC-00184 - Generating hprof files

Description

Flow Server is Java based. Sometimes generating a heap dump is an important debug tool.

Solution

Use jmap to create a hprof dump of the Flow Server JVM.

jmap is not installed as part of the JRE. It is only available as part of the Java-1.6 JDK found at http://www.oracle.com/technetwork/java/javase/overview/index.html.

  1. Find the JDK version on the system. Use "java -version" to see which version is on your system.
  2. Go to the "Downloads" tab, "Previous Releases" subtab, to select the appropriate entry:
    1. Build 1.7 is in use with the 4.2.x versions of the product, eg: 1.7u15 for 4.2.1
  3. Select the appropriate "Java SDK" for your environment.
    1. For example: jre-6u21-windows-x64.exe

Example

jmap -dump:format=b,file=server_pid<pid>.hprof <pid>
or for Windows wrap this call around psexec:
psexec -i 0 "C:\Program Files\Java\<CORRECT JAVA VERSION DIR>\bin\jmap.exe" -dump:format=b,file=server_pid<pid>.hprof <pid>

The hprof file is also created when the JRE crashes. By default, the file name is "java_pid<pid>.hprof" and found in:

  1. /opt/electriccloud/electriccommander/bin on Linux
  2. C:\Documents and Settings\All Users\Application Data\Electric Cloud\ElectricCommander\bin on Windows

Compress this file and copy it to the Electric Cloud Sharefile site by using an HTTP GUI at https://electric-cloud.sharefile.com/login.aspx

Notes

On Linux, ulimit can have an effect on the ability for jmap to create the output file. Use the following command as root to set the output file size to unlimited.

unlimit -c unlimited

When running jmap, you should use the user ID of the process you’re dumping; it won’t work if you’re running as root.

You can find more on JRE debug here http://docs.oracle.com/cd/E19747-01/819-0079/dgdebug.html

 

For Windows, the psexec tool can be found from Microsoft at the following link:

http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx

More Notes

To generate the Heap Dump you will need the pid number for the Flow server or the Agent java process.


For generating the heap dump you will need the actual java process pid ( for the agent or the server) and NOT the pid of the wrapper process that you see in:

a) /opt/electriccloud/electriccommander/logs/agent/agent.pid or
b) /opt/electriccloud/electriccommander/server/commander.pid files .

Those files contain the pid's of the wrapper process and can be used to get the thread dump but not the Heap Dump.

Also the jmap command has to be run as the same user as the user who started the server/agent.

Have more questions? Submit a request

Comments

Powered by Zendesk