Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
    
Have you tried checking what is actually taking up the space? Not so easy if it's in zz, but fairly simple if it's in one of the others – Tetsujin Oct 5 '15 at 16:00
    
Yes, it's thankfully not being caused by anything in zz, it's a folder named tr. What's the significance of zz, as opposed to any other folder listed? – Lee S Oct 5 '15 at 16:05
    
it's not an area of the OS I'm truly familiar with, but the contents of zz usually don't belong to you, so you need to fiddle with chmod to even see in them [not something i'd really advise unless you're feeling particularly cavalier] I think the others seem to have almost random codes, though I've not studied it. My other 2 are g5 & nc - no relationship with anything I can imagine in themselves – Tetsujin Oct 5 '15 at 16:08
    
I'm fairly ok with the zz folder being left as is - it's not the culprit to this problem. From other places I've read from, and from this other thread, you can delete some folders from here without negative effects, so long as you don't delete the folder itself. – Lee S Oct 5 '15 at 16:13
    
What I really want to know is why this is happening now in El Capitan, when it never happened in Yosemite and any previous releases. – Lee S Oct 5 '15 at 16:18
up vote 2 down vote accepted

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.

share|improve this answer
1  
I would say this is less safe than "closing all running apps" safe. The system stores files there as well as the user. For example, the command set | grep TMP will show your your current user temporary folder in /var - on my Mac right now, it's /var/folders/6p/2ws_5ft14n10v_1kzp9tjhg00000gn/T/ - I would say closing apps and deleting from there might be a decent troubleshooting step, but you might need to narrow down what is writing large temp files for the problem might keep coming back if you don't dig into what specifically is being saved there. – bmike Dec 1 '15 at 14:14

I have had the same problem with the huge "folders". The command looks like a quick way to go and I'll try this out next time I get the big files appearing.

I manage over 400 macs and this issue has been happening since 10.9 through 10.10 and now it seems 10.11. The strange thing is that it is only apparent on a certain model of iMac, 2GHZ Intel Core 2 Duo, Macs. All the other later iMacs we use dont seem to have the problem at all.

I first noticed this problem when our helpdesk got calls from students who couldnt save work and when I checked these macs the hard drives were almost full(150GB hard drives). I manually trashed the var/folders some of which were over 100GB and the space was released but the iMacs gradually fill up again.

I havent cleared any of these Macs lately to see if the 10.11 El Capitan upgrade has fixed this issue.

share|improve this answer
1  
I would be interested in knowing a little more detail which folders contain the large files. sudo find /var/folders -size 500M might work well for that. – bmike Dec 1 '15 at 14:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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