Linux – Why is systemd-coredump storing the dump in memory itself

core-dumplinuxsystemd

I just noticed that most of my memory was hogged by coredump of a few processes that I had killed recently. I had a systemd-coredump process running for each crashed process (usually the processes were google-chrome, which I had force quit, which explains the large memory consumption).

What I would like to know is why instead of dumping the core of the crashed process to the disk, a new process that holds the entire core in the ram is being started.

Is my configuration buggy or is it supposed to be this way? If so how do I change the behavior?

For now I have disabled the storing of core dump by linking /dev/null to /etc/sysctl.d/coredump.conf, though I do not see core dumps, but still would like to keep it enabled. Any ideas/hints would be appreciated.

(The issue is also posted at: https://bbs.archlinux.org/viewtopic.php?pid=1246237)

Best Answer

By default, core dumps are written to disk and should not be written to memory. See the core manual page for further information. You can find out, and change, the path and filename of the core file by looking at /proc/sys/kernel/core_pattern

You can simply disable core dumps by redirecting coredump.conf to null

$ sudo ln -s /dev/null /etc/sysctl.d/coredump.conf && /lib/systemd/systemd-sysctl

Another way to disable core dumps is by changing the settings in limits.conf

Related Question