How do I manage core dumps on Linux?

To aid in troubleshooting, core dumps are sometimes enabled. A core dump file is the memory image of an executable program when it was terminated by the operating system due to various error behavior. Whenever a process is killed, a core.PID file will be created in the working directory.

If you are concerned about filesystem space, you may remove these files at any time.

If you would like to disable core dumps entirely, modify /etc/profile to contain the following line:

ulimit -S -c 0 > /dev/null 2>&1

If you wish to re-enable core dumps, change the same line to read:

ulimit -S -c unlimited > /dev/null 2>&1

If you want to check the status of core dumps, use the ulimit command:

[root@eclipse ~]# ulimit -a
core file size (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 1064960
max locked memory       (kbytes, -l) 32
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 10240
cpu time               (seconds, -t) unlimited
max user processes              (-u) 1064960
virtual memory          (kbytes, -v) unlimited
file locks                      (-x) unlimited