lib/memory: improve log message about the memory allowed to use by VictoriaMetrics

This commit is contained in:
Aliaksandr Valialkin 2020-08-16 16:04:11 +03:00
parent ed00eb3f33
commit 7c0d6a8b88

View file

@ -38,12 +38,13 @@ func initOnce() {
} }
percent := *allowedPercent / 100 percent := *allowedPercent / 100
allowedMemory = int(float64(mem) * percent) allowedMemory = int(float64(mem) * percent)
remainingMemory = mem - allowedMemory
logger.Infof("limiting caches to %d bytes, leaving %d bytes to the OS according to -memory.allowedPercent=%f", allowedMemory, remainingMemory, *allowedPercent)
} else { } else {
allowedMemory = *allowedBytes allowedMemory = *allowedBytes
remainingMemory = mem - allowedMemory
logger.Infof("limiting caches to %d bytes, leaving %d bytes to the OS according to -memory.allowedBytes=%d", allowedMemory, remainingMemory, *allowedBytes)
} }
remainingMemory = mem - allowedMemory
logger.Infof("limiting caches to %d bytes, leaving %d bytes to the OS according to -memory.allowedPercent=%f and -memory.allowedBytes=%d",
allowedMemory, remainingMemory, *allowedPercent, *allowedBytes)
} }
// Allowed returns the amount of system memory allowed to use by the app. // Allowed returns the amount of system memory allowed to use by the app.