JDK-8024425 : VM_HeapDumper doesn't put anonymous classes in the heap dump
  • Type: Bug
  • Component: hotspot
  • Sub-Component: svc
  • Affected Version: hs25
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-09-06
  • Updated: 2016-12-12
  • Resolved: 2013-10-11
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 8 Other
8Fixed hs25Fixed
Related Reports
Relates :  
Description
These failures were spotted in the 2013-09-05 Main_Baseline nightly.

  JDK: Java(TM) SE Runtime Environment 1.8.0 b106 (1.8.0-ea-b106)
  VM:  Java HotSpot(TM) 64-Bit Server VM 25.0 b49 (25.0-b49-internal-201309051228.thomas.hs-merge)

jcmd/gc/heap_dump/className
jcmd/gc/heap_dump/cmdFile
jcmd/gc/heap_dump_all/className
jcmd/gc/heap_dump_all/cmdFile
jcmd/gc/heap_dump_all/pid
jcmd/gc/heap_dump/pid

    These tests fail due to the following:

[2013-09-06T08:09:20.59] Launching process by command line: /export/local/aurora/sandbox/sca/vmsqe/jdk/nightly/product/main_baseline/linux-amd64//bin/jcmd jcmd.gc.heap_dump.HeapDump GC.heap_dump  jcmd.gc.heap_dump.hprof
[2013-09-06T08:09:21.49] Test failure: hprof output contains warning or error
[2013-09-06T08:09:21.49]        at jcmd.gc.heap_dump.HeapDump.launchJhat(HeapDump.java:44)
[2013-09-06T08:09:21.50] Test failure: hprof output contains warning or error
[2013-09-06T08:09:21.50]        at jcmd.gc.heap_dump.HeapDump.launchJhat(HeapDump.java:44)
[2013-09-06T08:09:21.52] Test failure: hprof output contains warning or error
[2013-09-06T08:09:21.52]        at jcmd.gc.heap_dump.HeapDump.launchJhat(HeapDump.java:44)
[2013-09-06T08:09:21.52] Test failure: hprof output contains warning or error
[2013-09-06T08:09:21.52]        at jcmd.gc.heap_dump.HeapDump.launchJhat(HeapDump.java:44)
[2013-09-06T08:09:21.53] Test failure: hprof output contains warning or error
[2013-09-06T08:09:21.53]        at jcmd.gc.heap_dump.HeapDump.launchJhat(HeapDump.java:44)
[2013-09-06T08:09:21.66] # Test level exit status: 97
Comments
Fredrik, are you looking at this?
23-09-2013

I suppose that the problem is in VM_HeapDumper, which doesn't know about anonymous classes. What it does to dump classes is enumerate SystemDictionary, but anonymous classes aren't registered there: src/share/vm/services/heapDumper.cpp: 1660 // The VM operation that dumps the heap. The dump consists of the following 1661 // records: 1662 // 1663 // HPROF_HEADER 1664 // [HPROF_UTF8]* 1665 // [HPROF_LOAD_CLASS]* 1666 // [[HPROF_FRAME]*|HPROF_TRACE]* 1667 // [HPROF_GC_CLASS_DUMP]* 1668 // HPROF_HEAP_DUMP ... 1683 void VM_HeapDumper::doit() { ... 1724 // write HPROF_LOAD_CLASS records 1725 SystemDictionary::classes_do(&do_load_class); 1726 Universe::basic_type_classes_do(&do_load_class);
10-09-2013

The issue isn't specific to jcmd GC.heap_dump, the dump created by jmap has the same issue.
10-09-2013

Tests fail because jhat fails to resolve some of the references in the generated heap dump: $ jhat jcmd.gc.heap_dump.hprof Reading from jcmd.gc.heap_dump.hprof... Dump file created Fri Sep 06 21:17:02 MSK 2013 Snapshot read, resolving... Resolving 10183 objects... WARNING: Failed to resolve object id 0x11d489088 for field clazz (signature L) WARNING: Failed to resolve object id 0x11d488f08 for field clazz (signature L) WARNING: Failed to resolve object id 0x11d489108 for field clazz (signature L) WARNING: Failed to resolve object id 0x11d489008 for field clazz (signature L) WARNING: Failed to resolve object id 0x11d488f88 for field clazz (signature L) Chasing references, expect 2 dots.. Eliminating duplicate references.. Snapshot resolved. Started HTTP server on port 7000 Server is ready.
10-09-2013