4

I've been trying to dump the heap file when an OutOfMemoryError occurs on a given Java process using Jmap.

I have been able to dump the heap file but I want to add the HeapDumpOnOutOfMemoryError flag to Jmap but I think I'm doing something wrong. Am I doing something wrong? I've tried:

jmap -J-XX:+HeapDumpOnOutOfMemoryError -dump:live,file=/home/eduardo2/dumpfile.hprof 18763

When I run the above it just says the following -- but it doesn't wait for the OutOfMemoryError:

>> Dumping heap to /home/eduardo2/dump21file.hprof ...
>> Heap dump file created
trincot
  • 317,000
  • 35
  • 244
  • 286
Eduardo Morales
  • 764
  • 7
  • 29

1 Answers1

5

You are mixing up two different things:

wwerner
  • 4,227
  • 1
  • 21
  • 39