Skip to content
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

8255984: Shenandoah: "adaptive" heuristic is prone to missing load spikes #1099

Closed
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
b6bc703
Add a "reactive" heuristic for triggering concurrent GC cycles
earthling-amzn Nov 5, 2020
2efc73c
Incorporate review feed back
earthling-amzn Nov 10, 2020
7f1de19
Merge 'reactive' heuristic into 'adaptive' heuristic
earthling-amzn Nov 10, 2020
66dd531
Rename ShenandoahReactive flags to ShenandoahAdaptive flags.
earthling-amzn Nov 12, 2020
275e80a
Remove const qualifier from should_start_gc
earthling-amzn Nov 12, 2020
8b2528a
Restore call to reset allocation counter at cycle start
earthling-amzn Nov 13, 2020
8e204f4
Make logging messages more consistent
earthling-amzn Nov 13, 2020
ec99e2d
Rename variables to improve readability
earthling-amzn Nov 13, 2020
5d0512a
Reuse instantaneous_rate method instead of duplicating code
earthling-amzn Nov 13, 2020
98d459b
Use os::elapsedTime to avoid type issues and to be consistent with ot…
earthling-amzn Nov 13, 2020
6ef8dc6
Inline calls to gc decision methods (vestige of an earlier design)
earthling-amzn Nov 13, 2020
543afbb
Defend against underflow and division by zero
earthling-amzn Nov 16, 2020
3ec8f3c
Remove dependency from allocation rate to adaptive heuristic
earthling-amzn Nov 16, 2020
f6bb039
Fix wrong type for os::elapsedTime
earthling-amzn Nov 17, 2020
02f5c2d
Merge branch 'master' into shenandoah-reactive-heuristic
earthling-amzn Nov 17, 2020
85c32e4
Avoid recomputing instantaneous allocation rate
earthling-amzn Nov 19, 2020
68ba628
Remove unused member
earthling-amzn Nov 19, 2020
45c0f51
Sample allocation rate even if cumulative bytes allocated hasn't changed
earthling-amzn Nov 20, 2020
8b58ec8
Do not re-sample allocation rate with higher frequency
earthling-amzn Nov 20, 2020
72f15a6
Factor rate check into is_spiking
earthling-amzn Nov 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -258,17 +258,15 @@ bool ShenandoahAdaptiveHeuristics::should_start_gc() {
return true;
}

if (rate > 0.0) {
bool is_spiking = _allocation_rate.is_spiking(rate, _spike_threshold_sd);
if (is_spiking && avg_cycle_time > allocation_headroom / rate) {
log_info(gc)("Trigger: Average GC time (%.2f ms) is above the time for instantaneous allocation rate (%.0f %sB/s) to deplete free headroom (" SIZE_FORMAT "%s) (spike threshold = %.2f)",
avg_cycle_time * 1000,
byte_size_in_proper_unit(rate), proper_unit_for_byte_size(rate),
byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom),
_spike_threshold_sd);
_last_trigger = SPIKE;
return true;
}
bool is_spiking = _allocation_rate.is_spiking(rate, _spike_threshold_sd);
if (is_spiking && avg_cycle_time > allocation_headroom / rate) {
log_info(gc)("Trigger: Average GC time (%.2f ms) is above the time for instantaneous allocation rate (%.0f %sB/s) to deplete free headroom (" SIZE_FORMAT "%s) (spike threshold = %.2f)",
avg_cycle_time * 1000,
byte_size_in_proper_unit(rate), proper_unit_for_byte_size(rate),
byte_size_in_proper_unit(allocation_headroom), proper_unit_for_byte_size(allocation_headroom),
_spike_threshold_sd);
_last_trigger = SPIKE;
return true;
}

return ShenandoahHeuristics::should_start_gc();
@@ -338,6 +336,10 @@ void ShenandoahAllocationRate::allocation_counter_reset() {
}

bool ShenandoahAllocationRate::is_spiking(double rate, double threshold) const {
if (rate <= 0.0) {
return false;
}

double sd = _rate.sd();
if (sd > 0) {
// There is a small chance that that rate has already been sampled, but it