From eb5aa9ad02eef1b73caddaf709d7cacb65f09a7e Mon Sep 17 00:00:00 2001 From: Jan Eitzinger Date: Wed, 28 Jan 2026 11:21:02 +0100 Subject: [PATCH] Disable explicit GC calls --- pkg/metricstore/checkpoint.go | 17 ++++++++--------- pkg/metricstore/metricstore.go | 7 +++---- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/pkg/metricstore/checkpoint.go b/pkg/metricstore/checkpoint.go index c301058b..715566e4 100644 --- a/pkg/metricstore/checkpoint.go +++ b/pkg/metricstore/checkpoint.go @@ -43,7 +43,6 @@ import ( "os" "path" "path/filepath" - "runtime" "sort" "strconv" "strings" @@ -396,14 +395,14 @@ func enqueueCheckpointHosts(dir string, work chan<- [2]string) error { } gcCounter++ - if gcCounter%GCTriggerInterval == 0 { - // Forcing garbage collection runs here regulary during the loading of checkpoints - // will decrease the total heap size after loading everything back to memory is done. - // While loading data, the heap will grow fast, so the GC target size will double - // almost always. By forcing GCs here, we can keep it growing more slowly so that - // at the end, less memory is wasted. - runtime.GC() - } + // if gcCounter%GCTriggerInterval == 0 { + // Forcing garbage collection runs here regulary during the loading of checkpoints + // will decrease the total heap size after loading everything back to memory is done. + // While loading data, the heap will grow fast, so the GC target size will double + // almost always. By forcing GCs here, we can keep it growing more slowly so that + // at the end, less memory is wasted. + // runtime.GC() + // } work <- [2]string{clusterDir.Name(), hostDir.Name()} } diff --git a/pkg/metricstore/metricstore.go b/pkg/metricstore/metricstore.go index 25f4547e..38ff9015 100644 --- a/pkg/metricstore/metricstore.go +++ b/pkg/metricstore/metricstore.go @@ -447,9 +447,9 @@ func MemoryUsageTracker(wg *sync.WaitGroup, ctx context.Context) { } } - if freedEmergency > 0 { - debug.FreeOSMemory() - } + // if freedEmergency > 0 { + // debug.FreeOSMemory() + // } runtime.ReadMemStats(&mem) actualMemoryGB = float64(mem.Alloc) / 1e9 @@ -460,7 +460,6 @@ func MemoryUsageTracker(wg *sync.WaitGroup, ctx context.Context) { cclog.Infof("[METRICSTORE]> emergency freeing complete: %d buffers freed, memory now %.2f GB", freedEmergency, actualMemoryGB) } } - } } }()