[Lxc-users] total RAM limit
Gary Ballantyne
gary.ballantyne at haulashore.com
Sat Feb 2 10:03:22 UTC 2013
On Fri, 1 Feb 2013 10:24:13 -0600
Serge Hallyn <serge.hallyn at canonical.com> wrote:
>
> Did you actually test with a memory hog program? I just noticed there
> appears to be a bug in that if I
>
> d=/sys/fs/cgroup/memory/a
> mkdir $d
> echo 1 > $d/memory.use_hierarchy
> echo 5000 > $d/memory.limit_in_bytes
> mkdir $d/b
>
> then $d/b/memory.limit_in_bytes does not report the reduced limit. However
> whenI run a program which does char *c = malloc(10000) after doing
> echo $$ > $d/b/tasks
>
> then I get killed by OOM.
>
> -serge
I tested with a large array in ipython. Though, from your example, it seems I'm missing memory.use_hierarchy.
In principle, it seems like I need something like:
echo 1 > /sys/fs/cgroup/memory/lxc/memory.use_hierarchy
But, I can't do that before the container is started (no lxc directory) or after it is started (device busy).
More information about the lxc-users
mailing list