4 ms·
What 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 memor
by saagarjha 7y ago
What 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.