Clearing caches without restart - possible? desirable?

Whenever I restart it seems my mac gives me back 3G or more of free diskspace from nowhere. Before my last restart, I had 9G free. After the restart I had 15G free.

I assume this is cache files that Mac OS X clears up during a restart.

Does anyone know which files this may be? Is there any clean way of getting rid of them without restarting?

I have looked for suspicious files in my home directory, but there are no visible files there that raise any suspicions. I realise there may be some in places like /private/var, but I would like to avoid going in there and delete files without knowing that it is safe.

PowerBook G4, Mac OS X (10.5)

Posted on May 12, 2008 10:46 AM

Reply
8 replies

May 12, 2008 9:21 PM in response to SermoDaturCunctis

Neither MacJanitor nor Onix answer my question - which files take up a lot of space, and can one delete them without a restart.

However, I stumbled upon the swap files in /private/var/vm . They are reasonably big, and they are recreated with a restart. That is probably the bulk of the issue. And deleting swap files on the go is rarely a good idea, so I will just keep them.

May 13, 2008 9:36 AM in response to Andreas 

Whenever I restart it seems my mac gives me back 3G or more of free diskspace from nowhere. Before my last restart, I had 9G free. After the restart I had 15G free.


Also, if there is more than the default 64MB, and based on above, my take:

Repair your drive. It is usually prudent to keep free space from getting below 10-15%, and performance will suffer as you get beyond 70% used.

I only felt safe clearing caches with Applejack under Tiger and earlier, and always did so before any OS update which can also help.

But right now I would update your cloned backup, so you have a good 2nd boot drive to run repairs - and run Disk Utility to repair your drive, but also follow that up, even if it doesn't report errors, with Disk Warrior (4.1).

Leopard Cache Cleaner can work on other boot drives which is safest way. And it will force restart if you do use it to remove swap files. I suspect they or the directory was actually having errors or "corrupt." Which is also a good time to deep clean cache files.

Caches are often the last and most recent files written to disk, and getting rid of them, would get rid of potential problems with the directory as well. They also can be affected by changes and updates to OS X, from 10.5.1 to 10.5.2 for instance.

Bigger disk drive and more RAM.

Oh, and Leopard Cache Cleaner has something close to what Applejack did, and gets run in Single User Mode startup from command line.

May 13, 2008 11:35 AM in response to The hatter

Yes, I definitely agree on the disk space and your guess on RAM shortage is probably also valid.

I often run Aperture, Bridge and Photoshop at the same time as EyeTV is recording one movie and playing another with just 2G RAM. I actually ran out of diskspace completely recently, when a few films I recorded turned out to be bigger than I had expected.

I'm just waiting for Apple to come up with a laptop I think is worthwhile. I would like the leap to be bigger than it is between what I have and what I would buy today.

May 18, 2008 3:45 AM in response to SermoDaturCunctis

If anyone has more info about swap files it would be nice hearing it.

Last time I restarted, 13th May, a file swapfile0 of 67 Megabyte was created. It has not changed since then according to the last modified date.

Since then, the files swapfile1, swapfile2, swapfile3, swapfile4, swapfile5 and swapfile6 have been created with increasing sizes. swapfile5 and swapfile6 were more than 1 Gigabyte each. swapfile6 disappeared when I closed a few applications.

I ask myself what swapfile0 does with its 67 Megabyte that never change. I assume it contains data that only is read, once the system is started, like font metrics, but it would be interesting if anyone knows more about it.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Clearing caches without restart - possible? desirable?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.