Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

(JRE) - -XX:+HeapDumpOnOutOfMemoryError Not Working...

843798Nov 11 2008 — edited Nov 20 2008
So, I've tried this with multiple JVM's and it never creates a heap dump file. Tried it with and without the -XX:HeapDumpPath option set. According to this...

http://java.sun.com/javase/6/webnotes/trouble/TSG-VM/html/gdaog.html#gbzrr

I should be seeing something like this...

Dumping heap to java_pid2262.hprof ...
Heap dump file created [531535128 bytes in 14.691 secs]

But I don't. Just the following...

C:\temp>java com.localhost.oom.Main -Xms12m -Xmx12m -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=C:\temp\oom.hprof
init...
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.<init>(HashMap.java:181)
at java.util.HashMap.<init>(HashMap.java:193)
at com.localhost.oom.Main.main(Main.java:28)

C:\temp>java com.localhost.oom.Main -Xms12m -Xmx12m -XX:+HeapDumpOnOutOfMemoryError
init...
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.util.HashMap.<init>(HashMap.java:181)
at java.util.HashMap.<init>(HashMap.java:193)
at com.localhost.oom.Main.main(Main.java:28)

C:\temp>java -version
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b02)
Java HotSpot(TM) Client VM (build 1.5.0_16-b02, mixed mode)

Any ideas what I'm doing wrong???
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 18 2008
Added on Nov 11 2008
2 comments
1,508 views