How to create memory dumps for out of memory.

If system is out of memory then oom-killer kills the process which occupies highest memory by some calculations.

How can we get core dump of the process killed


Even if your kernel was configured to generate a core dump, the OOM killer would not cause a core dump to be produced because it sends a SIGKILL.

As decribed in signal's man page (7), SIGKILL does not produce a core dump.

The only way to change that behavior would therefore require a custom patch to the kernel.

  • Can we get crash dump? Tried to configure /etc/sysctl.conf with following parameter. vm.panic_on_oom=1 but it didn't work – Sasikiran Vaddi Aug 27 '16 at 1:36
  • I am able to get crash dumps when I have used the custom c script for OOM which is present in this link debuntu.org/how-to-reboot-on-oom . But when kernel triggers oom-killer to kill the highest used process(kernel logs are observed in /var/log/kern.log), it is not triggering the panic signal. Is it because of kernel libraries? Does any patch needs to be applied in kernel to trigger panic signals. – Sasikiran Vaddi Aug 28 '16 at 6:20
  • Like I mentioned, you'd need to change the signal sent and enable core dumps in your kernel. – Julie Pelletier Aug 28 '16 at 14:17
Configured vm.panic_on_oom=2 in /etc/sysctl.conf, which solves my problem.


  • panic_on_oom


This enables or disables panic on out-of-memory feature.

If this is set to 0, the kernel will kill some rogue process, called oom_killer. Usually, oom_killer can kill rogue processes and system will survive.

If this is set to 1, the kernel panics when out-of-memory happens. However, if a process limits using nodes by mempolicy/cpusets, and those nodes become memory exhaustion status, one process may be killed by oom-killer. No panic occurs in this case. Because other nodes' memory may be free. This means system total status may be not fatal yet.

If this is set to 2, the kernel panics compulsorily even on the above-mentioned. Even oom happens under memory cgroup, the whole system panics.

The default value is 0. 1 and 2 are for failover of clustering. Please select either according to your policy of failover. panic_on_oom=2+kdump gives you very strong tool to investigate why oom happens. You can get snapshot.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.