CJRE for certain platforms can be configured with a 'dump tool' support that allows for additional runtime information to be generated by JRE.  This information can be used in analyzing memory leaks, thread execution, memory allocation, etc.  Here, we present a short guide to obtaining and using dump data for analysis of Java application.

Installation.

    alternatively

Setting up JREs.

  • contact Apogee to ascertain whether 'dump tool' support is available for your target configuration
  • configure the location of the dump files that will be generated (via environment variables)
    • specify directory where 'java dump' files are created.  These files thread and monitor-related information.
      • % export IBM_JAVACOREDIR=/tmp/jcore
    • specify directory where 'heap dump' files are created.  These files contain heap memory-related information.
      • % export IBM_HEAPDUMPDIR=/tmp/hcore
    • specify directory where 'native core' files are created.  These files contain system core information.
      • % export IBM_COREDIR=/tmp/core
  • configure available dump features
    • specify whether 'java dump' files should not be created (default:false, i.e. create)
      • % export DISABLE_JAVADUMP=[true|false]
    • specify whether 'java dump' files should be created when OutOfMemoryError is thrown (default:false)
      • % export IBM_JAVADUMP_OUTOFMEMORY=[true|false]
    • specify whether 'heap dump' files should be created when SIGQUIT is received (default:true)
      • % export IBM_HEAPDUMP=[true|false]
    • specify whether 'heap dump' files should be created when OutOfMemoryError is thrown (default:false)
      • % export IBM_HEAPDUMP_OUTOFMEMORY=[true|false]
    • specify whether JRE does not rename 'core' files (default:false, i.e. rename)
      • % export J9NO_DUMP_RENAMING=[true|false]

Generating dump information.

The creation of dump files can be requested explicitly by the user by sending a SIGQUIT signal (% kill -3 $PID) to the JRE.  Depending on the settings of environment variables, JRE may generate dump files when OutOfMemoryError is encounterd by the Java application.  As part of the dump information, the following files are generated:
  • heapdump.$date.$time.$pid.0001.phd
    • binary file containing heap dump information to be used with 'Heap Analyzer' tool
    • % java -jar ha3912.jar heapdump.*.phd
  • javacore.$date.$time.$pid.0002.txt
    • text file containing thread and monitor information to be used with 'Thread and Monitor Dump Analyzer' tool
    • % java -jar jca396.jar  javacore.*.txt
Additionally, when JRE encounters SIGSEGV, SIGILL or SIGFPE conditions, it will generate an additional system core file, suitable for examination under native debugger (e.g. gdb)
  • core.$date.$time.$pid.0001.dmp (or 'core' if J9NO_DUMP_RENAMING=true)
    • system core file to be used with gdb
    • % gdb $JRE/bin/java core.*.dmp