hotspot/src/share/vm/gc_implementation/g1/concurrentMark.cpp
void work(int i) {
{- -------------------------------------------
(1) CalcLiveObjectsClosure を引数として
G1CollectedHeap::heap_region_par_iterate_chunked() または G1CollectedHeap::heap_region_iterate() を呼び出し,
Live Data Counting 処理を行う.
(G1CollectedHeap::use_parallel_gc_threads() が true であれば,
G1CollectedHeap::heap_region_par_iterate_chunked() を使ってマルチスレッドで処理する.
そうでなければ, G1CollectedHeap::heap_region_iterate() によるシングルスレッド処理を行う.)
---------------------------------------- -}
CalcLiveObjectsClosure calccl(true /*final*/,
_bm, _g1h->concurrent_mark(),
_region_bm, _card_bm);
calccl.no_yield();
if (G1CollectedHeap::use_parallel_gc_threads()) {
_g1h->heap_region_par_iterate_chunked(&calccl, i,
HeapRegion::FinalCountClaimValue);
} else {
_g1h->heap_region_iterate(&calccl);
}
{- -------------------------------------------
(1) (assert)
---------------------------------------- -}
assert(calccl.complete(), "Shouldn't have yielded!");
assert((size_t) i < _n_workers, "invariant");
{- -------------------------------------------
(1) 数えた結果をフィールドに記録しておく.
---------------------------------------- -}
_live_bytes[i] = calccl.tot_live();
_used_bytes[i] = calccl.tot_used();
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.