--- a/src/hotspot/share/memory/heapInspection.cpp Tue Mar 26 09:16:07 2019 +0100
+++ b/src/hotspot/share/memory/heapInspection.cpp Tue Mar 26 10:23:11 2019 +0100
@@ -121,6 +121,11 @@
}
KlassInfoEntry* KlassInfoBucket::lookup(Klass* const k) {
+ // Can happen if k is an archived class that we haven't loaded yet.
+ if (k->java_mirror() == NULL) {
+ return NULL;
+ }
+
KlassInfoEntry* elt = _list;
while (elt != NULL) {
if (elt->is_equal(k)) {
@@ -202,7 +207,8 @@
assert(_buckets != NULL, "Allocation failure should have been caught");
KlassInfoEntry* e = _buckets[idx].lookup(k);
// Lookup may fail if this is a new klass for which we
- // could not allocate space for an new entry.
+ // could not allocate space for an new entry, or if it's
+ // an archived class that we haven't loaded yet.
assert(e == NULL || k == e->klass(), "must be equal");
return e;
}