Turn off core dumps for one or all users
May 30, '03 10:06:00PM
Contributed by: bostmass
Mac OS X's UNIX core has a nice feature that works when a program crashes. It tries to keep a record of what was going on at the time the program gave up the ghost, but for a normal user, this isn't a particularly useful feature -- unless you're a programmer. With that said, it's usually best to disable it. To do so, add the following line to your home directory's .cshrc file. To prevent all users from saving coredumps, you can turn it off in the /etc/csh.cshrc file with these instructions:
- From the terminal, type cd /etc. You should be in the etc directory.
- Type sudo pico csh.cshrc and enter your password when prompted. This will open csh.cshrc, and allow you to edit the file.
- Scroll to the end of the file and add the following line:
limit coredumpsize 0
That's the line you would add to your .cshrc if you're just changing the settings for one user.
- Hit Control-X, press Y, then Enter.
- Restart your computer, or type limit coredumpsize 0 in the Terminal to have it take affect immediately.
If you ever decide that you need coredumps turned on temporarily, you can type unlimit coredumpsize in the Terminal. This will turn coredumps on for the duration of the shell. Or delete the line you just added in the .cshrc file completely.
[robg adds: I haven't tested this one.]
Comments (22)
Mac OS X Hints
http://hints.macworld.com/article.php?story=20030528135219694