mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-01-28 15:01:46 +01:00
Disable explicit GC calls
This commit is contained in:
@@ -43,7 +43,6 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path"
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -396,14 +395,14 @@ func enqueueCheckpointHosts(dir string, work chan<- [2]string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gcCounter++
|
gcCounter++
|
||||||
if gcCounter%GCTriggerInterval == 0 {
|
// if gcCounter%GCTriggerInterval == 0 {
|
||||||
// Forcing garbage collection runs here regulary during the loading of checkpoints
|
// 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.
|
// 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
|
// 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
|
// almost always. By forcing GCs here, we can keep it growing more slowly so that
|
||||||
// at the end, less memory is wasted.
|
// at the end, less memory is wasted.
|
||||||
runtime.GC()
|
// runtime.GC()
|
||||||
}
|
// }
|
||||||
|
|
||||||
work <- [2]string{clusterDir.Name(), hostDir.Name()}
|
work <- [2]string{clusterDir.Name(), hostDir.Name()}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -447,9 +447,9 @@ func MemoryUsageTracker(wg *sync.WaitGroup, ctx context.Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if freedEmergency > 0 {
|
// if freedEmergency > 0 {
|
||||||
debug.FreeOSMemory()
|
// debug.FreeOSMemory()
|
||||||
}
|
// }
|
||||||
|
|
||||||
runtime.ReadMemStats(&mem)
|
runtime.ReadMemStats(&mem)
|
||||||
actualMemoryGB = float64(mem.Alloc) / 1e9
|
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)
|
cclog.Infof("[METRICSTORE]> emergency freeing complete: %d buffers freed, memory now %.2f GB", freedEmergency, actualMemoryGB)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|||||||
Reference in New Issue
Block a user