I’ve been aware since the day I bought this Mac that it was going to be space constrained. I have a lot of pictures that I like to keep locally, and so I’ve always kept an eye on the amount of free space it had. Lately, I’ve had around 30 GB or so free, so it was a shock when I suddenly got an alert in the middle of editing a scan that I only had a GB or so remaining.
With OS X, this is an emergency, since it uses disk space (or rather, SSD space) to facilitate virtual memory. My first thought was that the Photoshop scratch file had gotten out of hand, so I quit Photoshop. Not much improvement. Then I figured maybe the OS X swap file — the file the operating system uses for virtual memory—had gotten too big, so I restarted.
Still not much improvement. The Finder was reporting only about 7 GB free, which is still unusable. So I fired up Daisy Disk, to be able to visualize where my free space had gone. My pictures folder was big, but that was not new. Then I spotted the culprit: a 47 GB log file that Mail had created.
My first impulse was to open the file, and see what was in it, and promptly locked up the machine hard. It was too big to open, and I couldn’t do anything. Reluctantly then, I powered it down, and restarted. Once I restarted, I was able to delete the offending file, after quitting Mail, which had auto started, and the machine was under control again.
The next job was to figure out why the file had been created in the first place. I’d deleted the file without being able to see what was in there, so I don’t know the proximate cause. I suspect some temporary difficulty with my web host. But the underlying cause was that at some point, I’d used Mail’s Connection Doctor (Window > Connection Doctor) and enabled logging. There were a number of logs saved in the
/Users/_username_/Library/Containers/com.apple.mail/Data/Library/Logs folder. I turned off the logging option in the Connection Doctor window.
I still don’t know what caused it to dump so much data so fast — I think it was over the course of the day, since I remember noting free space in the morning, but at least, it shouldn’t fill up again. I also think I’ve solved the mystery of how I managed to gain back lots of free space when I moved to this machine; there were probably log files that weren’t copied over by the Migration Assistant.
Since this Mac uses an SSD, I’m a little concerned that there may be long term effects from having filled it up to capacity. SSDs prefer to write to empty space, and don’t alway mark freed space as empty. But for now, I’m back in business.