Core dump files

Filed Under (Articles) by WebScHoLaR on 19-02-2008

Tagged Under :

You may have seen core.xxxx (where xxxx can be any number) files on your server and noticed that these files consume alot of space and sometimes a disk partition reaches its limit because its full of core dump files. So whats this file for? Basically when any process crashes or get terminated abnormally then kernel dumps the data residing in the memory at that time in to a core file so that it can be debugged later to find the cause of abnormal termination. The detailed and well explained description can be found at Core dumps. If you want to clear up these core files consuming your server’s disk space then you can run the following command:

find / -name “core.[0-90-9]*” -type f ! \( -name virtfs -type d \) -print | xargs rm -vf

The above command will search the entire server for any file named core.xx and will delete it. Before running this command, I would recommend to first check that what will be deleted by running:

find / -name “core.[0-90-9]*” -type f ! \( -name virtfs -type d \) -print

It will show all the core files present on the server. You should go through the list and if you see that all are core dump files then use the first command to delete all the core dump files to free up the space.

Use the “file” command to see what application caused them to be generated. For example:

$ file core.1234

They were most likely the result of a PHP process crashing for some reason that would require further investigation, such as with gdb:

$ gdb /usr/bin/php core.1234

Leave a Reply

You must be logged in to post a comment.

Proudly Hosted by eServicesProvider