1

"-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp" This parameter will help to take heap dump automatically when server limit is reached.

http://www.oracle.com/technetwork/java/javase/clopts-139448.html#gbzrr

I can see detailed information on above link but, "OutOfMemoryError" message prints so many times in my server log times.

So, If the error msg occurs multiple times, will JVM take multiple heap dump ?

Regards, Peter

DeepInJava
  • 1,871
  • 3
  • 16
  • 31
Peter Jerald
  • 723
  • 2
  • 8
  • 24

2 Answers2

2

The oracle jvm creates a heap dump only on the first OOM when this flag is specified. However you can manually create multiple heapdumps if the jvm process is still alive and responsive. A little bit of googling:
-XX:+HeapDumpOnOutOfMemoryError not creating hprof file in OOM

Community
  • 1
  • 1
Khanna111
  • 3,627
  • 1
  • 23
  • 25
0

It depends on the JVM. I think the Oracle JVM only dumps once.

keuleJ
  • 3,418
  • 4
  • 30
  • 51