-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generation resizing #177
Generation resizing #177
Changes from all commits
f6b9369
d2e1ce7
72a7478
1d94a19
3eb53d6
bc50b60
2a54600
179c713
cd4cacf
f974b1b
959bb05
2718ba0
b916a90
03c2ebd
41f057f
d7a0194
50896e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -625,6 +625,8 @@ class ShenandoahInitWorkerGCLABClosure : public ThreadClosure { | |
|
||
void ShenandoahHeap::post_initialize() { | ||
CollectedHeap::post_initialize(); | ||
_mmu_tracker.initialize(); | ||
|
||
MutexLocker ml(Threads_lock); | ||
|
||
ShenandoahInitWorkerGCLABClosure init_gclabs; | ||
|
@@ -1093,6 +1095,13 @@ void ShenandoahHeap::coalesce_and_fill_old_regions() { | |
parallel_heap_region_iterate(&coalesce); | ||
} | ||
|
||
bool ShenandoahHeap::adjust_generation_sizes() { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this method idempotent? I guess it depends on the method of the same name in the MMU Tracker. I guess my question will be answered when I get to it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Left a related comment in |
||
if (mode()->is_generational()) { | ||
return _mmu_tracker.adjust_generation_sizes(); | ||
} | ||
return false; | ||
} | ||
|
||
HeapWord* ShenandoahHeap::allocate_new_tlab(size_t min_size, | ||
size_t requested_size, | ||
size_t* actual_size) { | ||
|
@@ -1741,6 +1750,7 @@ void ShenandoahHeap::prepare_for_verify() { | |
|
||
void ShenandoahHeap::gc_threads_do(ThreadClosure* tcl) const { | ||
tcl->do_thread(_control_thread); | ||
tcl->do_thread(_regulator_thread); | ||
workers()->threads_do(tcl); | ||
if (_safepoint_workers != NULL) { | ||
_safepoint_workers->threads_do(tcl); | ||
|
@@ -1772,6 +1782,33 @@ void ShenandoahHeap::print_tracing_info() const { | |
} | ||
} | ||
|
||
void ShenandoahHeap::on_cycle_start(GCCause::Cause cause, ShenandoahGeneration* generation) { | ||
set_gc_cause(cause); | ||
set_gc_generation(generation); | ||
|
||
shenandoah_policy()->record_cycle_start(); | ||
generation->heuristics()->record_cycle_start(); | ||
|
||
// When a cycle starts, attribute any thread activity when the collector | ||
// is idle to the global generation. | ||
_mmu_tracker.record(global_generation()); | ||
} | ||
|
||
void ShenandoahHeap::on_cycle_end(ShenandoahGeneration* generation) { | ||
generation->heuristics()->record_cycle_end(); | ||
|
||
if (mode()->is_generational() && | ||
((generation->generation_mode() == GLOBAL) || upgraded_to_full())) { | ||
// If we just completed a GLOBAL GC, claim credit for completion of young-gen and old-gen GC as well | ||
young_generation()->heuristics()->record_cycle_end(); | ||
old_generation()->heuristics()->record_cycle_end(); | ||
} | ||
set_gc_cause(GCCause::_no_gc); | ||
|
||
// When a cycle ends, the thread activity is attributed to the respective generation | ||
_mmu_tracker.record(generation); | ||
} | ||
|
||
void ShenandoahHeap::verify(VerifyOption vo) { | ||
if (ShenandoahSafepoint::is_at_shenandoah_safepoint()) { | ||
if (ShenandoahVerify) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this translate to a GC overhead of 1/71*100% = 1.4%?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a confusingly named parameter, but I'm interpreting it based on the description:
Any time the average MMU drops below this number, it attempts to resize the generations.