14

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.

8
  • 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
    Commented Oct 5, 2015 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?
    – LewdLime
    Commented Oct 5, 2015 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
    Commented Oct 5, 2015 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.
    – LewdLime
    Commented Oct 5, 2015 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.
    – LewdLime
    Commented Oct 5, 2015 at 16:18

4 Answers 4

12

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.

2
  • 2
    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
    Commented Dec 1, 2015 at 14:14
  • Is it safe to delete /private/? As there is not much else in the lower directories anyway, my 100GB is used from /private/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/Cleanup At Startup/SMSandboxTools-tmp/Users/ian/Library! Commented Jun 29, 2017 at 8:47
2

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.

1
  • 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
    Commented Dec 1, 2015 at 14:10
1

I'm unsure if this will work in everyone's case (and I know this is an old thread), but a good old-fashioned reboot is often all it takes to clear up these cache files:

http://osxdaily.com/2016/01/13/delete-temporary-items-private-var-folders-mac-os-x/

Of course, this method may not work on all setups, however I recommend this method because there are several websites which do NOT recommend deleting items in /var/folders, /private/var/folders/ or /tmp.

https://discussions.apple.com/thread/3757828

1
  • This was one thing that was tried, and in in some cases, it wouldn't delete all the files stored in this cache.
    – LewdLime
    Commented Mar 2, 2017 at 21:18
1

I had the same problem on El Capitan (MacOS 10.11). I managed to get the Terminal app started and noticed that "lsd" (LaunchServiceDaemon) was using 100% of one core.

The fix was to rebuild the Launch Services database with the command in this Apple discussion thread.

1
  • Welcome to Ask Different. The answer in the link is quite short. It's better to include the answer here as links often go stale making this answer useless.
    – Allan
    Commented Mar 14, 2018 at 18:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .