0

Is there any way for a Linux application to be notified that the OOM killer is about to kill a process, or has killed it?

System is Ubuntu 14.04 ARM v7, 512MB, 3.18.5 kernel.

SeanLabs
  • 165
  • 1
  • 8
  • 1
    You could use a log scanner and report (somehow) when OOM kill logs appear in the system log. – thrig Sep 15 '17 at 17:18
  • Thanks. I would try that if I can't find any other solution. Would prefer some type of direct callback mechanism however (e.g. only incurs overhead if the situation occurs). – SeanLabs Sep 16 '17 at 15:41
  • 1
    Running new code while the system is under memory pressure probably won't help with the recovery from said condition, though. – thrig Sep 16 '17 at 17:30
  • @thrig correct. What I had in mind was registering some type of OOM callback to some existing application level processe(s) that are running (these being not the main memory hogs) so that we can record the event & perhaps try to restart the killed process or report & reboot. – SeanLabs Sep 17 '17 at 18:10

0 Answers0