On 01/18/2015 03:24 AM, Yamaban wrote:
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>:
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.
The Java VM has it's own memory allocation system. If your program is a java program, then you should probably use the -Xmx... option.
OTOH, the manpage of prlimit contains at least one error:
"... separated by a semicolon (:), in ..."
Uh, tell the other one, (:) is colon, (;) is semicolon.
That typo's already been fixed upstream last July, and also on openSUSE-13.2 (util-linux-2.25.1). Have a nice day, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org