How to limit memory of a OS X program? ulimit -v neither -m are working

Posted by hectorpal on Stack Overflow See other posts from Stack Overflow or by hectorpal
Published on 2010-07-18T04:57:55Z Indexed on 2010/12/28 20:54 UTC
Read the original article Hit count: 124

Filed under:
|
|
|
|

My programs run out of memory like half of the time I run them. Under Linux I can set a hard limit to the available memory using ulimit -v mem-in-kbytes. Actually, I use ulimit -S -v mem-in-kbytes, so I get a proper memory allocation problem in the program and I can abort.

But... ulimit is not working in OSX 10.6. I've tried with -s and -m options, and they are not working.

In 2008 there was some discussion about the same issue in MacRumors, but nobody proposed a good alternative. The should be a way a program can learn it's spending too much memory, or setting a limit through the OS.

© Stack Overflow or respective owner

Related posts about linux

Related posts about osx