未验证 提交 037f733c 编写于 作者: X Xiaofan 提交者: GitHub

Fix GCTuner Overflow (#20498)

Signed-off-by: Nxiaofan-luan <xiaofan.luan@zilliz.com>
Signed-off-by: Nxiaofan-luan <xiaofan.luan@zilliz.com>
上级 c5c68753
......@@ -58,12 +58,12 @@ func optimizeGOGC() {
heapuse := m.HeapInuse
totaluse := hardware.GetUsedMemoryCount()
heapTarget := memoryThreshold - (totaluse - heapuse)
var newGoGC uint32
if heapTarget < heapuse {
if totaluse > memoryThreshold {
newGoGC = minGOGC
} else {
heapTarget := memoryThreshold - (totaluse - heapuse)
newGoGC = uint32(math.Floor(float64(heapTarget-heapuse) / float64(heapuse) * 100))
if newGoGC < minGOGC {
newGoGC = minGOGC
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册