[Devel] Re: No limitation in physical memory in cgroups
nishimura at mxp.nes.nec.co.jp
Tue May 19 23:30:55 PDT 2009
Thank you for using memory cgroup :)
On Wed, 20 May 2009 13:52:29 +0800, anqin <anqin.qin at gmail.com> wrote:
> Hi all,
> I would like to bind given physical memory to specific task group,
> however it does not take effect in my experiments. Are there
> something wrong in my experiments.
> My experiment is done under the kernel 18.104.22.168 and I constructed
> my task group by following commands:
> a) In shell #1, prepare a bash :
> # bash
> # echo $$
> b) In shell #2, prepare the memory control via cgroupfs:
> # mount -t cgroup cgroup /mnt/mycgrp
> # cd /mn/mycgrp
> # mkdir mycontainer
> # echo 0 > mycontainer/cpuset.mems
> # echo 0-1 > mycontainer/cpuset.cpus
> # echo 2252 > mycontainer/tasks
> # cat mycontainer/memory.usage_in_bytes
> # echo 3000000 > mycontainer/memory.max_usage_in_bytes
> # cat mycontainer/memory.max_usage_in_bytes
You need to write the limit to memory.limit_in_bytes.
max_usage_in_bytes means the max of the usage so far(you can reset it
by writing to it).
See Documentation/cgroups/memory.txt(it might be a bit old).
> c) In Shell #1, run a memory consumer (in which, malloc() is called
> to allocate memory and not free until program is existed) to allocate
> 500M memory:
> # /tmp/memoy_consumer_program 500
> In Shell #2, the used memory ascends from start point 2875392 when
> program begins (from number presented in memory.usage_in_bytes),
> but it return to start point when it touches the maximal boundary.
> On the other hand, I also run the top to watch the memory hold by
> memoy_consumer_program. In top, the memory (both virtual and rss
> memory ) is always growing without any limitation.
> Is this phenomenon the correct behaviors of memory cgroups?
> Best Regards,
> Containers mailing list
> Containers at lists.linux-foundation.org
Containers mailing list
Containers at lists.linux-foundation.org
More information about the Devel