I have problems with processes that leak memory. They cause my hard drive to be filled with swap files in
I would like leaking processes to be killed at sight by the OS. I’m not interested in a dialog that appears after 20 minutes, suggests applications to kill, and doesn’t even show the one that is leaking.
I have tried setting the
data limits in
/etc/launchd.conf but it didn’t seem to have an effect.
This is my
limit data 8589934592 8589934592 limit rss 8589934592 8589934592
Here is the
launchctl limit output:
% launchctl limit cpu unlimited unlimited filesize unlimited unlimited data 8589934592 8589934592 stack 8388608 67104768 core 0 unlimited rss 8589934592 8589934592 memlock unlimited unlimited maxproc 709 1064 maxfiles 256 unlimited
This is my
ulimit -t 600 ulimit -d 512000 ulimit -v 1024000
ulimit -a output (in ZSH):
% ulimit -a -t: cpu time (seconds) 600 -f: file size (blocks) unlimited -d: data seg size (kbytes) 512000 -s: stack size (kbytes) 8192 -c: core file size (blocks) 0 -v: address space (kb) 1000 -l: locked-in-memory size (kb) unlimited -u: processes 709 -n: file descriptors 256
Yet here is what
top tells me about the process:
PID COMMAND %CPU TIME #TH #WQ #POR #MRE RPRVT RSHRD RSIZE VPRVT VSIZE PGRP PPID 886 process 30.8 01:16.40 1/1 0 17 332 2259M+ 184K 2072M- 19G+ 38G 882 885
It just seems that none of the documented memory limitation methods actually work. Is there an additional mechanism that I may have missed?