[Lxc-users] lxc.cgroup.memory.limit_in_bytes has no effect

Ulli Horlacher framstag at rus.uni-stuttgart.de
Tue May 17 06:34:23 UTC 2011


Memory limitation does not work for me:

root at vms2:/lxc# uname -a
Linux vms2 2.6.32-31-server #61-Ubuntu SMP Fri Apr 8 19:44:42 UTC 2011 x86_64 GNU/Linux

root at vms2:/lxc# grep CONFIG_CGROUP_MEM_RES_CTLR
/boot/config-2.6.32-31-server
CONFIG_CGROUP_MEM_RES_CTLR=y
CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y

root at vms2:/lxc# grep limit_in_bytes /lxc/flupp.cfg
lxc.cgroup.memory.limit_in_bytes = 536870912

root at vms2:/lxc# lxc-version         
lxc version: 0.7.4.1

root at vms2:/lxc# lxc-start -d -n flupp -f /lxc/flupp.cfg
root at vms2:/lxc# lxc-console -n flupp

Type <Ctrl+a q> to exit the console

root at flupp:~# ls -l /tmp/1GB.tmp
-rw-r--r-- 1 root root 1073741824 2011-05-17 06:06 /tmp/1GB.tmp

root at flupp:~# clp
Command Line Perl with readline support, @ARGV and Specials. Type "?" for help.
(perl):: undef $/; open F,'/tmp/1GB.tmp' or die; $_=<F>; print length

1073741824


Why can a container process allocate more than 1 GB of memory if there is
512 MB limit?


-- 
Ullrich Horlacher              Server- und Arbeitsplatzsysteme
Rechenzentrum                  E-Mail: horlacher at rus.uni-stuttgart.de
Universitaet Stuttgart         Tel:    ++49-711-685-65868
Allmandring 30                 Fax:    ++49-711-682357
70550 Stuttgart (Germany)      WWW:    http://www.rus.uni-stuttgart.de/




More information about the lxc-users mailing list