8224531: SEGV while collecting Klass statistics
Reviewed-by: coleenp, kbarrett, tschatzl
--- a/src/hotspot/share/memory/heapInspection.cpp Tue Jul 09 16:39:37 2019 +0200
+++ b/src/hotspot/share/memory/heapInspection.cpp Tue Jul 09 16:39:41 2019 +0200
@@ -123,7 +123,7 @@
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) {
+ if (k->java_mirror_no_keepalive() == NULL) {
return NULL;
}
@@ -719,7 +719,7 @@
ResourceMark rm;
RecordInstanceClosure ric(cit, filter);
- Universe::heap()->object_iterate(&ric);
+ Universe::heap()->safe_object_iterate(&ric);
return ric.missed_count();
}
--- a/src/hotspot/share/oops/klass.cpp Tue Jul 09 16:39:37 2019 +0200
+++ b/src/hotspot/share/oops/klass.cpp Tue Jul 09 16:39:41 2019 +0200
@@ -767,7 +767,7 @@
// Size Statistics
void Klass::collect_statistics(KlassSizeStats *sz) const {
sz->_klass_bytes = sz->count(this);
- sz->_mirror_bytes = sz->count(java_mirror());
+ sz->_mirror_bytes = sz->count(java_mirror_no_keepalive());
sz->_secondary_supers_bytes = sz->count_array(secondary_supers());
sz->_ro_bytes += sz->_secondary_supers_bytes;