lib/storage: properly limit the size of storage/date_metricID cache

This commit is contained in:
Aliaksandr Valialkin 2021-07-12 14:25:14 +03:00
parent f3a5465ece
commit 4f80b2f230

View file

@ -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()
}
}