JDK-8059340 : ConstantPool::_resolved_references is missing in heap dump
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-09-29
  • Updated: 2017-08-30
  • Resolved: 2015-05-21
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 9
9 b69Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
ConstantPool::_resolved_references is missing in heap dump.
It manifests as a unreachable Object[] arrays when you browse the heap dump.
Comments
The fix in the comment is essentially what I implemented for the other bug.
30-08-2017

Suggested fix: diff --git a/src/share/vm/classfile/vmSymbols.hpp b/src/share/vm/classfile/vmSymbols.hpp --- a/src/share/vm/classfile/vmSymbols.hpp +++ b/src/share/vm/classfile/vmSymbols.hpp @@ -243,6 +243,7 @@ template(signature_name, "signature") \ template(slot_name, "slot") \ template(selectAlternative_name, "selectAlternative") \ + template(resolved_references_name, "resolved_references") \ \ /* Support for annotations (JDK 1.5 and above) */ \ \ diff --git a/src/share/vm/services/heapDumper.cpp b/src/share/vm/services/heapDumper.cpp --- a/src/share/vm/services/heapDumper.cpp +++ b/src/share/vm/services/heapDumper.cpp @@ -814,6 +814,12 @@ if (fldc.access_flags().is_static()) field_count++; } + oop resolved_references = ((InstanceKlass*)k)->constants()->resolved_references(); + + if (resolved_references != NULL) { + ++field_count; + } + writer->write_u2(field_count); // pass 2 - dump the field descriptors and raw values @@ -831,6 +837,12 @@ dump_field_value(writer, sig->byte_at(0), addr); } } + + if (resolved_references != NULL) { + writer->write_symbolID(vmSymbols::resolved_references_name()); + writer->write_u1(HPROF_NORMAL_OBJECT); + writer->write_objectID(resolved_references); + } } // dump the raw values of the instance fields of the given object
29-09-2014