From 4f80b2f230e7dd8f7a758423e16961b8af34682f Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Mon, 12 Jul 2021 14:25:14 +0300 Subject: [PATCH] lib/storage: properly limit the size of `storage/date_metricID` cache --- lib/storage/storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/storage/storage.go b/lib/storage/storage.go index a8f879bf6..9109d3832 100644 --- a/lib/storage/storage.go +++ b/lib/storage/storage.go @@ -2094,7 +2094,7 @@ func (dmc *dateMetricIDCache) syncLocked() { atomic.AddUint64(&dmc.syncsCount, 1) - if dmc.EntriesCount() > memory.Allowed()/128 { + if dmc.SizeBytes() > uint64(memory.Allowed())/256 { dmc.resetLocked() } }