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 d9f7ea1c6e
commit 1b5467f7fd

View file

@ -38,12 +38,13 @@ func initOnce() {
}
percent := *allowedPercent / 100
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 {
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.