Linux – How to make OOM killer log into /var/log/messages when it kills any process

linuxout of memory

I use CentOS 7 with kernel 3.1.0

I know there is a hitman in Linux called oom killer which kills a process that uses too much memory out of available space.

I want to configure it to log the activities so that I can check whether it happens or not. How can I set it up?

Thanks,

Best Answer

OOMkiller's activities are guaranteed to be in /var/log/dmesg (at least for a time). Usually the system logger daemon will also put it in /var/log/messages by default on most distributions with which I've worked.

These commands might be of help in tracking the logs down:

grep oom /var/log/*
grep total_vm /var/log/*

This answer has more details about parsing those log entries to see exactly what is going on.

Related Question