Im using a program called Daisy Disk to see what is taking up space in my Mac and I find that the /cores directory is taking up 77gb.

Is that a problem? Can I get rid of it to regain the space?

enter image description here

  • What does launchctl limit core show for core size allowances? By default you should have nothing there with a soft limit of 0 size. Did you perhaps enable core dumps or can trace what specific files are being placed there? – bmike Nov 17 '15 at 23:22

Long story short, it's safe to delete them.

The /cores folder is where OS X stores Core Dumps. These are files that are intended for developers to trouble-shoot and diagnose faults in their software. They are generated as software crashes. If you're not a developer, or aren't testing software for a developer, then these files serve no purpose for you.

The files contain the state of the memory (or RAM) in your Mac at the time the crash happened. So lots of useful information for developers or testers to debug crashes. Not much use to anyone else.

By default, OS X is set up not to generate core dump files. If you type sudo launchctl limit core in a Terminal window it will respond with the soft and hard size limits of dump files it is allowed to create. Soft limit means the default for each process, however processes can change this if they require but only up to the value of the hard limit. By default the values in OS X seem to be "0 unlimited" means that the operating system won't create core dumps by default, but processes can elect to have unlimited core dump files created if they wish.

You can change the setting on your machine by simply entering sudo launchctl limit core 0 0 to disable the feature entirely. sudo launchctl limit core 0 unlimited will restore the default behaviour if it has been changed.

  • 1
    Does ulimit -c do anything beyond the current shell process? On Linux it won't. – abligh Nov 13 '15 at 12:57
  • 1
    @AlistairMcMillan I am pretty sure it only effects processes which are descendants of the current shell. To enable core dumps globally, I believe you need to fiddle with launchctl. See developer.apple.com/library/mac/documentation/Darwin/Reference/… – abligh Nov 13 '15 at 14:13
  • 1
    @AlistairMcMillan ah! I thought that was the ulimit manpage. But I meant the line above re launchctl. – abligh Nov 13 '15 at 14:55
  • 1
    @abligh Updated my answer. Hopefully it makes sense. – Alistair McMillan Nov 14 '15 at 4:04
  • 1
    Helpful command to delete any older than 30 days: cd /cores; sudo find . -mtime +30 -type f -delete – turtlemonvh Jun 8 '16 at 22:43

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.