JDK-6306922 : Dump dump created by +HeapDumpOnOutOfMemoryError should include stack traces for stack roots
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2005-08-05
  • Updated: 2011-03-08
  • Resolved: 2011-03-08
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 Other
6u14Fixed hs14Fixed
Related Reports
Relates :  
Relates :  
Relates :  
The dump file produced by +HeapDumpOnOutOfMemoryError when OutOfMemoryError is thrown includes stack roots (both locals and JNI locals). These locals are emitted to the dump with an empty stack trace. It would be desirable to emit the stack trace all threads so that the stack roots could be better understood.
This work is also related to the new heap snapshot format that we hope to include in JDK 7, see
for more information.

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/4d05b7cb7842

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-svc/hotspot/rev/4d05b7cb7842

EVALUATION Snapshot the thread dump at heap dump time and include the stack traces as HPROF_TRACE and HPROF_FRAME records. The following records will link with the proper stack trace: HPROF_GC_ROOT_THREAD_OBJ HPROF_GC_ROOT_JAVA_FRAME HPROF_GC_ROOT_JNI_LOCAL

EVALUATION The heap dump format is being redesigned for dolphin so that is a good time to revisit this issue. -- A JDC comment on this bug asked for +StackDumpOnOutOfMemoryError. Since mustang b34 there is a stack trace generated when OOME is thrown because the java heap or perm gen is full (see 4753347). Also, on Solaris and Linux it is possible to generate a complete thread dump at OOME time using this: -XX:OnOutOfMemoryError="jstack -F %p" This option runs the jstack utility when OOME is first thrown. The -F option means "force" and %p is replaced by the pid of the VM process.