View full program command line arguments in OOM killer logs
Is it possible to view full program command line arguments in OOM killler logs ? What I see now in /var/log/syslog is
Memory cgroup out of memory: Kill process 29187 (beam.smp) score 998 or sacrifice child
Killed process 29302 (cpu_sup) total-vm:4300kB, anon-rss:76kB, file-rss:272kB
beam.smp invoked oom-killer: gfp_mask=0xd0, order=0, oom_score_adj=0
beam.smp cpuset=/ mems_allowed=0-3
I have plenty of beam.smp processes on my machine and it's not very convenient to find out what particular process was killed by OOM killer.
echo 1 > /proc/sys/vm/oom_dump_tasks
which seems about the max that you can get the kernel to display on out-of-memory errors.
https://www.kernel.org/doc/Documentation/sysctl/vm.txt
Enables a system-wide task dump (excluding kernel threads) to be produced when the kernel performs an OOM-killing and includes such information as pid, uid, tgid, vm size, rss, nr_ptes, swapents, oom_score_adj score, and name. This is helpful to determine why the OOM killer was invoked, to identify the rogue task that caused it, and to determine why the OOM killer chose the task it did to kill.
If this is set to zero, this information is suppressed. On very large systems with thousands of tasks it may not be feasible to dump the memory state information for each one. Such systems should not be forced to incur a performance penalty in OOM conditions when the information may not be desired.
If this is set to non-zero, this information is shown whenever the OOM killer actually kills a memory-hogging task.
echo 1 > /proc/sys/vm/oom_dump_tasks
did not help me much - there're still no command line parameters in the log.
to retrospectively view command line of killed process, you can use atop to record system activity.
if oom-killer kills s/th, just open atop log for that time, find you process by PID from /var/log/syslog, and hit 'c' key to view command line of the process.