hotspot/src/share/vm/memory/genCollectedHeap.cpp
void GenCollectedHeap::collect(GCCause::Cause cause) {
{- -------------------------------------------
(1) CMS でかつ条件が満たされていれば, GenCollectedHeap::collect_mostly_concurrent() を呼び出す
(See: GenCollectedHeap::should_do_concurrent_full_gc)
そうでなければ, GenCollectedHeap::collect() を呼び出す.
(なお, 呼び出し元が GCCause::_scavenge_alot の場合のみ Minor GC とする. 他の場合は Full GC)
---------------------------------------- -}
if (should_do_concurrent_full_gc(cause)) {
#ifndef SERIALGC
// mostly concurrent full collection
collect_mostly_concurrent(cause);
#else // SERIALGC
ShouldNotReachHere();
#endif // SERIALGC
} else {
#ifdef ASSERT
if (cause == GCCause::_scavenge_alot) {
// minor collection only
collect(cause, 0);
} else {
// Stop-the-world full collection
collect(cause, n_gens() - 1);
}
#else
// Stop-the-world full collection
collect(cause, n_gens() - 1);
#endif
}
}
This document is available under the GNU GENERAL PUBLIC LICENSE Version 2.