MacOS – El Capitan /private/var/folders cache files consuming 30–40 GB

disk-spacemacbook promacosnvram

I've upgraded my MacBook Pro to El Capitan recently, and one of the first unpleasant changes, other than XtraFinder & TotalTerminal no longer being compatible, is that the system deems it appropriate to make /private/var/folders to consume up to and beyond 30–40 GB of space, causing my Mac to slow down tremendously. I understand that the files within this folder are all cache files. My only question is why this is happening, and what makes this happen? Is there any way to make it only cache apps that are actually open, or do I have to refresh my NVRAM/PRAM? It's exceedingly annoying to have my computer act like its trying to buffer 20 gigabytes all at once.

Best Answer

The answer is that yes, you are allowed to delete files from /private/var/folders/. The command

sudo rm -r -P /private/var/folders/tr/*

was able to work and no crashes came of it. Some errors were issued by the command, but no errors came from the system as a whole. I might issue a new post later on when I know more about this to understand what Apple did with El Capitan to make it act this way.

Here's a thread from the Apple website about this; it agrees that deleting tr should be safe. According to the thread, /var/folders is the new location of caches, which you can safely delete if you've closed all running apps.

UPDATE: Another reason for this behavior can be due to Spotlight indexing, especially on older models of MacBook / MacBook Pro. I recently noticed the problem happening again, and even though I had done everything I could to prevent it from continuing to happen, I was forced to watch my Mac slowly consume more than 100 gigabytes of space to some phantom process occurring in the background.

Even so, be sure to go into Settings -> Spotlight & uncheck the box for Folders indexing, and if you're like me and have a lot of music (such as over 50 gigabytes), turn off Music indexing, too. Turn off any others you may not want, as well, but Folder indexing seems to be the biggest culprit in both disk space loss and performance slowdown on older MacBook models.

Upon turning this off, I have not seen any issues. Additionally, the remaining disk space displayed in Finder now provides accurate results.

This may also apply to iOS devices, since OS X & iOS are currently being developed to match each other's functionality and features. A large portion of the Other data stored on the device may just be Spotlight indexing not giving a toot about how much disk space it consumes. It won't hurt to try turning some features / options off if you notice issues.