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 390a31ccfa
commit 3f705fe8d7

View File

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