On Sun, 18 Jan 2015 02:58, Andrea Turrini <andrea.turrini@...> wrote:
2015-01-16 19:18 GMT+08:00 Bernhard Voelker <mail@bernhard-voelker.de>:
prlimit(1) is just a wrapper around prlimit(3) which in turn is just a newer syscall combining getrlimit(3) and setrlimit(3).
Did you mean the AS field then?
Example: "dd'ing by 700M chunks in memory"
$ prlimit --as=800000000 dd if=/dev/zero of=/dev/null bs=700M count=2 2+0 records in 2+0 records out 1468006400 bytes (1.5 GB) copied, 0.44007 s, 3.3 GB/s
vs. "dd'ing by 900M chunks in memory"
$ prlimit --as=800000000 dd if=/dev/zero of=/dev/null bs=900M count=2 dd: memory exhausted by input buffer of size 943718400 bytes (900 MiB)
The AS field seems to affect the virtual memory, not the actual used one. As experiment, I tried to run a trivial test Java program: according to "ps uxa", resident memory is 25808 while virtual memory is 5587204. If I use "prlimit --as=1000000000 java test" (1GB), the JVM fails with the message: Error occurred during initialization of VM Could not reserve enough space for object heap Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.
You can obtain a similar situation using "ulimit -v 1000000", except that then you can not increase it anymore in the same shell.
I don't care whether the virtual memory is very high, it is the actually used one I care of.
Best, Andrea
FYI: Remarkable is the notice in "man bashbuiltins" section ulimits: ... -m The maximum resident set size (many systems do not honor this limit) ... The man-page to prlimit does not give that hint. OTOH, the manpage of prlimit contains at least one error: "... separated by a semicolon (:), in ..." Uh, tell the other one, (:) is colon, (;) is semicolon. - Yamaban. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org