hotspot/src/share/vm/memory/heapInspection.cpp
void HeapInspection::find_instances_at_safepoint(klassOop k, GrowableArray<oop>* result) {
{- -------------------------------------------
(1) (assert)
---------------------------------------- -}
assert(SafepointSynchronize::is_at_safepoint(), "all threads are stopped");
assert(Heap_lock->is_locked(), "should have the Heap_lock");
{- -------------------------------------------
(1)
---------------------------------------- -}
// Ensure that the heap is parsable
Universe::heap()->ensure_parsability(false); // no need to retire TALBs
{- -------------------------------------------
(1) CollectedHeap::object_iterate() (をサブクラスがオーバーライドしたもの) を呼び出し,
ヒープ中の全てのオブジェクトに対して FindInstanceClosure を適用する.
---------------------------------------- -}
// Iterate over objects in the heap
FindInstanceClosure fic(k, result);
// If this operation encounters a bad object when using CMS,
// consider using safe_object_iterate() which avoids perm gen
// objects that may contain bad references.
Universe::heap()->object_iterate(&fic);
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.