Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HeapDumpOnOutOfMemoryError

 
Todd Baxter
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The -XX:+HeapDumpOnOutOfMemoryError creates a heap dump on Out of memory.

The file is called java_pixXXX.hprof

WHERE IS THIS FILE CREATED? Relative to the Java install?
Can I specify where to create this file?

Any help appreciated.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
 
Greg Bishop
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've noticed that on JDK 1.5 if clean up (GC) occurs (you catch the out of memory exception and then free up the objects in question),( and then allocate another object forcing GC) the next occurrence does not generate another heap dump (I want one each time).

Is there some way to make it do this again and again?

Thanks,
-Greg Bishop
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. OutOfMemoryError is an ERROR not and Exception. It descends from java.lang.VirtualMachineError.
2. I would certainly not rely on the state of the program after an Error is thrown.

Bill
 
Chandra Varagani
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the *hprof file should be created in DOMAIN_HOME by default. and you can customise the path as well like -XX:HeapDumpPath=/folder1/folder2/log etc.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic