mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-21 11:34:38 +02:00
7011855: G1: non-product flag to artificially grow the heap
It introduces non-product cmd line parameter G1DummyRegionsPerGC which indicates how many "dummy" regions to allocate at the end of each GC. This allows the G1 heap to grow artificially and makes concurrent marking cycles more frequent irrespective of what the application that is running is doing. The dummy regions will be found totally empty during cleanup so this parameter can also be used to stress the concurrent cleanup operation. Reviewed-by: brutisso, johnc
This commit is contained in:
parent
236207402d
commit
12d1d9acc1
3 changed files with 37 additions and 0 deletions
|
@ -2113,6 +2113,28 @@ bool G1CollectedHeap::should_do_concurrent_full_gc(GCCause::Cause cause) {
|
|||
(cause == GCCause::_java_lang_system_gc && ExplicitGCInvokesConcurrent));
|
||||
}
|
||||
|
||||
#ifndef PRODUCT
|
||||
void G1CollectedHeap::allocate_dummy_regions() {
|
||||
// Let's fill up most of the region
|
||||
size_t word_size = HeapRegion::GrainWords - 1024;
|
||||
// And as a result the region we'll allocate will be humongous.
|
||||
guarantee(isHumongous(word_size), "sanity");
|
||||
|
||||
for (uintx i = 0; i < G1DummyRegionsPerGC; ++i) {
|
||||
// Let's use the existing mechanism for the allocation
|
||||
HeapWord* dummy_obj = humongous_obj_allocate(word_size);
|
||||
if (dummy_obj != NULL) {
|
||||
MemRegion mr(dummy_obj, word_size);
|
||||
CollectedHeap::fill_with_object(mr);
|
||||
} else {
|
||||
// If we can't allocate once, we probably cannot allocate
|
||||
// again. Let's get out of the loop.
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif // !PRODUCT
|
||||
|
||||
void G1CollectedHeap::increment_full_collections_completed(bool concurrent) {
|
||||
MonitorLockerEx x(FullGCCount_lock, Mutex::_no_safepoint_check_flag);
|
||||
|
||||
|
@ -3338,6 +3360,8 @@ G1CollectedHeap::do_collection_pause_at_safepoint(double target_pause_time_ms) {
|
|||
doConcurrentMark();
|
||||
}
|
||||
|
||||
allocate_dummy_regions();
|
||||
|
||||
#if YOUNG_LIST_VERBOSE
|
||||
gclog_or_tty->print_cr("\nEnd of the pause.\nYoung_list:");
|
||||
_young_list->print();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue