mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/memory: do not print trailing zeroes in logs for -memory.allowedPercent
command-line flag
This commit is contained in:
parent
abdf020e22
commit
5518b11720
1 changed files with 2 additions and 2 deletions
|
@ -35,12 +35,12 @@ func initOnce() {
|
||||||
mem := sysTotalMemory()
|
mem := sysTotalMemory()
|
||||||
if allowedBytes.N <= 0 {
|
if allowedBytes.N <= 0 {
|
||||||
if *allowedPercent < 1 || *allowedPercent > 200 {
|
if *allowedPercent < 1 || *allowedPercent > 200 {
|
||||||
logger.Panicf("FATAL: -memory.allowedPercent must be in the range [1...200]; got %f", *allowedPercent)
|
logger.Panicf("FATAL: -memory.allowedPercent must be in the range [1...200]; got %g", *allowedPercent)
|
||||||
}
|
}
|
||||||
percent := *allowedPercent / 100
|
percent := *allowedPercent / 100
|
||||||
allowedMemory = int(float64(mem) * percent)
|
allowedMemory = int(float64(mem) * percent)
|
||||||
remainingMemory = mem - allowedMemory
|
remainingMemory = mem - allowedMemory
|
||||||
logger.Infof("limiting caches to %d bytes, leaving %d bytes to the OS according to -memory.allowedPercent=%f", allowedMemory, remainingMemory, *allowedPercent)
|
logger.Infof("limiting caches to %d bytes, leaving %d bytes to the OS according to -memory.allowedPercent=%g", allowedMemory, remainingMemory, *allowedPercent)
|
||||||
} else {
|
} else {
|
||||||
allowedMemory = allowedBytes.N
|
allowedMemory = allowedBytes.N
|
||||||
remainingMemory = mem - allowedMemory
|
remainingMemory = mem - allowedMemory
|
||||||
|
|
Loading…
Reference in a new issue