From 1b5467f7fd307136e30e8cbbb08a66541977f5d0 Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Sun, 16 Aug 2020 16:04:11 +0300 Subject: [PATCH] lib/memory: improve log message about the memory allowed to use by VictoriaMetrics --- lib/memory/memory.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/memory/memory.go b/lib/memory/memory.go index d918caa0e..b7ce68fbc 100644 --- a/lib/memory/memory.go +++ b/lib/memory/memory.go @@ -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.