Greetings, and hoping this is the right forum.
I had something shocking happen today. I was running a process that rebuilds a 2TB database. About 5 hours into the process, it simply stopped. There was no crash report nor anything in the program's log output that would indicate a problem; the output just ended.
I eventually dug through the system.log and found the culprit:
Jul 7 16:02:14 madhatter kernel[0]: low swap: killing pid 4022 (QRecallHelper)
OMG!
So the kernel decided it was running low on memory and arbitrarily decided to kill my process???? I can't express how dismayed I am about this. How am I supposed to ship a program to customers that the kernel might decide to kill at any point, just because it's doing too much work? (Not to mention that I just lost 6 hours of rebuild work and now have to start over.)
I know my process is memory hungry, and can eat up as much as 6GB of RAM. But my system has 20GB of physical RAM and over 200GB of free disk space on the system volume, so I was in no danger of running out of addressable memory. Furthermore, the program is written so it scales its memory use so as not to exceed the physical RAM installed in the system (although it's VM foot print can often be larger due to memory mapped files and such).
Is there anyway of preventing this from happening? Is there some BSD function I can call that says "This process uses a lot of RAM, please don't kill it!!!!"