4 ms·
Throw a signal like it would do if the process were out of memory completely and about to be killed? (for clarification, no snark intended, actual question)
by chacham15 7y ago
Throw a signal like it would do if the process were out of memory completely and about to be killed? (for clarification, no snark intended, actual question)
- saagarjha 7y agoWhat signal is sent when a process is out of memory? I thought malloc would either start returning NULL or you’d fault when trying to access overcommitted memory.
- joosters 7y agoYes, but ideally you want to be throwing some ‘memory pressure’ signals before absolutely running out of memory, so that programs can take simple actions like emptying caches, etc. Catching an otherwise-fatal out-of-memory fault and recovering would be too complicated / bug-prone.
- pjmlp 7y agoAndroid sends low memory events and kills processes based on heuristics. Then again, Android has a customized Linux kernel.