Skip to content

Commit

Permalink
lib/memory: attempt #2 to determine memory limit inside LXC container
Browse files Browse the repository at this point in the history
Updates #84
  • Loading branch information
valyala committed Jun 28, 2019
1 parent 628571a commit d0732d3
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/memory/memory_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit d0732d3

Please sign in to comment.