On Thu, Jun 17, 2010 at 11:45:28AM +0200, Fabian Groffen wrote:
On 17-06-2010 11:20:59 +0200, Miguel Ángel Águila Lorente wrote:
Hello,
I'm trying to use ulimit to limit memory but it doesn't work. My steps are:
1. Open a shell 2. write ulimit -m 4194304 3. and start mserver5
When I'm in a client I execute a query and with comand top I can see that is using more than 4194304 kbytes.
After several trials I did the same but limiting the cpu time with:
ulimit -t 3
and it works fine, after 3 seconds the server was killed.
I don't understand what is happening, the only thing I can supouse is that ulimit can't be used with monet.
you're probably using Linux, it is known for not respecting it.
`ulimit -d` (not `ulimit -m` seems to work as expected on my Fedora 12 machine: ======== $ ulimit -a -------- core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited ^^^^^^^^^ scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 73216 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 1024 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited ======== $ mserver5 --version -------- MonetDB server v5.18.6 (64-bit), based on kernel v1.36.6 (64-bit oids) Copyright (c) 1993-July 2008 CWI Copyright (c) August 2008-2010 MonetDB B.V., all rights reserved Visit http://monetdb.cwi.nl/ for further information Found 7.8GiB available memory, 4 available cpu cores ^^^^^^ Configured for prefix: /ufs/manegold/_/scratch0/Monet/HG/Feb2010/prefix.--enable-strict_--disable-optimize_--enable-debug_--enable-assert Libraries: libpcre: 7.8 2008-09-05 (compiled with 7.8) openssl: OpenSSL 1.0.0 29 Mar 2010 (compiled with OpenSSL 1.0.0-fips 29 Mar 2010) libxml2: 2.7.6 (compiled with 2.7.6) Compiled by: manegold@rig.ins.cwi.nl (x86_64-unknown-linux-gnu) Compilation: gcc -Wall -Wextra -fno-strict-aliasing -g -Werror-implicit-function-declaration -Werror -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wp,-D_FORTIFY_SOURCE=2 Linking : ld -IPA -m elf_x86_64 ======== $ ulimit -d $[1024*1024] -------- ======== $ ulimit -a -------- core file size (blocks, -c) 0 data seg size (kbytes, -d) 1048576 ^^^^^^^ scheduling priority (-e) 0 file size (blocks, -f) unlimited pending signals (-i) 73216 max locked memory (kbytes, -l) 64 max memory size (kbytes, -m) unlimited open files (-n) 1024 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 real-time priority (-r) 0 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 1024 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited ======== $ mserver5 --version -------- MonetDB server v5.18.6 (64-bit), based on kernel v1.36.6 (64-bit oids) Copyright (c) 1993-July 2008 CWI Copyright (c) August 2008-2010 MonetDB B.V., all rights reserved Visit http://monetdb.cwi.nl/ for further information Found 1.0GiB available memory, 4 available cpu cores ^^^^^^ Configured for prefix: /ufs/manegold/_/scratch0/Monet/HG/Feb2010/prefix.--enable-strict_--disable-optimize_--enable-debug_--enable-assert Libraries: libpcre: 7.8 2008-09-05 (compiled with 7.8) openssl: OpenSSL 1.0.0 29 Mar 2010 (compiled with OpenSSL 1.0.0-fips 29 Mar 2010) libxml2: 2.7.6 (compiled with 2.7.6) Compiled by: manegold@rig.ins.cwi.nl (x86_64-unknown-linux-gnu) Compilation: gcc -Wall -Wextra -fno-strict-aliasing -g -Werror-implicit-function-declaration -Werror -Wpointer-arith -Wdeclaration-after-statement -Wundef -Wp,-D_FORTIFY_SOURCE=2 Linking : ld -IPA -m elf_x86_64 ======== Stefan -- | Dr. Stefan Manegold | mailto:Stefan.Manegold@cwi.nl | | CWI, P.O.Box 94079 | http://www.cwi.nl/~manegold/ | | 1090 GB Amsterdam | Tel.: +31 (20) 592-4212 | | The Netherlands | Fax : +31 (20) 592-4199 |