United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6306922 Dump dump created by +HeapDumpOnOutOfMemoryError should include stack traces for stack roots
6306922 : Dump dump created by +HeapDumpOnOutOfMemoryError should include stack traces for stack roots

Details
Type:
Enhancement
Submit Date:
2005-08-05
Status:
Closed
Updated Date:
2011-03-08
Project Name:
JDK
Resolved Date:
2011-03-08
Component:
hotspot
OS:
generic
Sub-Component:
svc
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
hs14

Related Reports
Backport:
Backport:
Relates:
Relates:
Relates:

Sub Tasks

Description
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
https://heap-snapshot.dev.java.net/
for more information.

                                    

Comments
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot/hotspot/rev/4d05b7cb7842
                                     
2008-10-16
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
                                     
2008-10-15
EVALUATION

http://hg.openjdk.java.net/jdk7/hotspot-svc/hotspot/rev/4d05b7cb7842
                                     
2008-10-15
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.
                                     
2006-05-24



Hardware and Software, Engineered to Work Together