Disable core file dumps on Mac

Mac OS X is still based on UNIX. Therefore OS X uses a lot of UNIX features. One of them are core dumps which are basically file dumps of your working memory in the moment of an app crashing. It helps a developer to look into why an app crashed or for an app to retrieve the last working environment.

Recently I ran into a full hard drive and had to look into what takes up how much space. Turns out there where a lot of those core dumps. Over 145GB of them to be more exact!

They are located in your root folder at /cores. I just deleted all of them with:

$ rm -f cores/*

You can disable the dumping of those core files with the following command:

$ sudo sysctl -w kern.coredump=0

But this won't be persisted through a restart. To do so create a new file on /etc/sysctl.conf (if it does not exist yet) and write in the following configuration:

comments powered by Disqus