14 Star 1 Fork 26

src-openEuler/openjdk-17

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Backport-of-8333088-ubsan-shenandoahAdaptiveHeuristi.patch 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
wuyafang 提交于 2024-10-14 16:06 . sync bishengjdk17 patch
Subject: Backport of 8333088: ubsan: shenandoahAdaptiveHeuristics.cpp: runtime error: division by zero
---
.../gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp
index 819f1e8d7..371e4c90c 100644
--- a/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp
+++ b/src/hotspot/share/gc/shenandoah/heuristics/shenandoahAdaptiveHeuristics.cpp
@@ -243,7 +243,7 @@ bool ShenandoahAdaptiveHeuristics::should_start_gc() {
double avg_cycle_time = _gc_time_history->davg() + (_margin_of_error_sd * _gc_time_history->dsd());
double avg_alloc_rate = _allocation_rate.upper_bound(_margin_of_error_sd);
- if (avg_cycle_time > allocation_headroom / avg_alloc_rate) {
+ if (avg_cycle_time * avg_alloc_rate > allocation_headroom) {
log_info(gc)("Trigger: Average GC time (%.2f ms) is above the time for average allocation rate (%.0f %sB/s) to deplete free headroom (" SIZE_FORMAT "%s) (margin of error = %.2f)",
avg_cycle_time * 1000,
byte_size_in_proper_unit(avg_alloc_rate), proper_unit_for_byte_size(avg_alloc_rate),
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/openjdk-17.git
git@gitee.com:src-openeuler/openjdk-17.git
src-openeuler
openjdk-17
openjdk-17
master

搜索帮助