Hi,

to allow for archiving objects in CDS that might not be loaded (e.g.,
JDK-8214712), we need to ignore objects at heap dump time that haven't
actually been loaded. This patch fixes the VM heapDumper implementation,
and is a mirror of a fix already done in the serviceability-agent heap
dumper[1].

Bug: https://bugs.openjdk.java.net/browse/JDK-8220682
Patch:
diff -r 082cd1e3c441 src/hotspot/share/services/heapDumper.cpp
--- a/src/hotspot/share/services/heapDumper.cpp Mon Dec 03 16:25:27 2018 +0100 +++ b/src/hotspot/share/services/heapDumper.cpp Fri Mar 15 13:11:28 2019 +0100
@@ -958,6 +958,11 @@
 // creates HPROF_GC_INSTANCE_DUMP record for the given object
 void DumperSupport::dump_instance(DumpWriter* writer, oop o) {
   Klass* k = o->klass();
+  if (k->java_mirror() == NULL) {
+ // Ignoring this object since the corresponding java mirror is not loaded.
+    // Might be a dormant archive object.
+    return;
+  }

   writer->write_u1(HPROF_GC_INSTANCE_DUMP);
   writer->write_objectID(o);


Thanks!

/Claes

[1] https://bugs.openjdk.java.net/browse/JDK-8214756

Reply via email to