Win a copy of Java Persistence with Spring Data and Hibernate this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

HeapDumpOnOutOfMemoryError

 
Greenhorn
Posts: 18
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
author
Posts: 3285
13
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi there,

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

Cheers,
Martijn
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Remember to always leap before you look. But always take the time to smell the tiny ads:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic