mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
lib/memory: attempt #2 to determine memory limit inside LXC container
Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/84
This commit is contained in:
parent
79ac02ba74
commit
7b59466667
1 changed files with 9 additions and 0 deletions
|
@ -31,6 +31,15 @@ func sysTotalMemory() int {
|
|||
if err != nil {
|
||||
return totalMem
|
||||
}
|
||||
if mem != totalMem {
|
||||
return mem
|
||||
}
|
||||
|
||||
// Try reading LXC memory limit, since it looks like the cgroup limit doesn't work
|
||||
mem, err = readLXCMemoryLimit(totalMem)
|
||||
if err != nil {
|
||||
return totalMem
|
||||
}
|
||||
return mem
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue