src/hotspot/share/memory/heapInspection.cpp
branchdatagramsocketimpl-branch
changeset 58678 9cf78a70fa4f
parent 54786 ebf733a324d4
child 58679 9c3209ff7550
equal deleted inserted replaced
58677:13588c901957 58678:9cf78a70fa4f
   121   }
   121   }
   122 }
   122 }
   123 
   123 
   124 KlassInfoEntry* KlassInfoBucket::lookup(Klass* const k) {
   124 KlassInfoEntry* KlassInfoBucket::lookup(Klass* const k) {
   125   // Can happen if k is an archived class that we haven't loaded yet.
   125   // Can happen if k is an archived class that we haven't loaded yet.
   126   if (k->java_mirror() == NULL) {
   126   if (k->java_mirror_no_keepalive() == NULL) {
   127     return NULL;
   127     return NULL;
   128   }
   128   }
   129 
   129 
   130   KlassInfoEntry* elt = _list;
   130   KlassInfoEntry* elt = _list;
   131   while (elt != NULL) {
   131   while (elt != NULL) {
   717 
   717 
   718 size_t HeapInspection::populate_table(KlassInfoTable* cit, BoolObjectClosure *filter) {
   718 size_t HeapInspection::populate_table(KlassInfoTable* cit, BoolObjectClosure *filter) {
   719   ResourceMark rm;
   719   ResourceMark rm;
   720 
   720 
   721   RecordInstanceClosure ric(cit, filter);
   721   RecordInstanceClosure ric(cit, filter);
   722   Universe::heap()->object_iterate(&ric);
   722   Universe::heap()->safe_object_iterate(&ric);
   723   return ric.missed_count();
   723   return ric.missed_count();
   724 }
   724 }
   725 
   725 
   726 void HeapInspection::heap_inspection(outputStream* st) {
   726 void HeapInspection::heap_inspection(outputStream* st) {
   727   ResourceMark rm;
   727   ResourceMark rm;
   790   // Ensure that the heap is parsable
   790   // Ensure that the heap is parsable
   791   Universe::heap()->ensure_parsability(false);  // no need to retire TALBs
   791   Universe::heap()->ensure_parsability(false);  // no need to retire TALBs
   792 
   792 
   793   // Iterate over objects in the heap
   793   // Iterate over objects in the heap
   794   FindInstanceClosure fic(k, result);
   794   FindInstanceClosure fic(k, result);
   795   // If this operation encounters a bad object when using CMS,
   795   Universe::heap()->safe_object_iterate(&fic);
   796   // consider using safe_object_iterate() which avoids metadata
   796 }
   797   // objects that may contain bad references.
       
   798   Universe::heap()->object_iterate(&fic);
       
   799 }