Search This Blog

Dump Java Heap when OutOfMemoryError occurs

  • Add argument
    -XX:+HeapDumpOnOutOfMemoryError
    and it will dump to java_pid.hprof file in the working directory.
  • Add argument
    -XX:HeapDumpPath=/path/to/output-dir
    to specify the output directory for the dump file. For example:
    -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=$HOME/JavaHeapDumps/






see also

No comments:

Post a Comment