Table of contents
No headings in the article.
This is not a guide but rather my personal experience and struggle with macOS temp files and how I resolved it. I am not sure if it matters but I use the latest update of macOS Catalina (10.15.7)
I had 884GB of my 1TB hard disk taken by macOS temp files. These files plus my files, apps and projects had reduced the free space to less than 100 MB (out of 1 TB) and nothing was working properly. I was getting disk space alert constantly.
These temp files are hidden so you will not find them in any reports. like when you look at storage analysis in macOS. It just comes under the category of Other
which does not tell you what or where the files are.If you google these many people have the same issue.
macOS storage analysis example showing others
Googling I found the “Other” category includes the following types of files:
System temporary files
macOS system folders
Archives and disk images (.zip, .iso, etc.)
Personal user data
Files from the user’s library (Application Support, iCloud files, screensavers, etc.)
Cache files
Fonts, plugins, extensions
Hidden files
Other files that are not recognized by a Spotlight search
I tried multiple techniques to make these hidden files visible.
- I restarted the machine and that seemed to release some disk. I got to 4GB free space.
- Using ncdu with command
sudo ncdu /
ncdu is a disk usage analyzer with a ncurses interface. It is designed to find space hogs on a remote server where you don’t have an entire graphical setup available, but it is a useful tool even on regular desktop systems. It takes a long time to analyse and for me was crashing halfway. I believe the size of disk or data was too big for this tool. Also for some reason, it was showing the size of the drive as 3.9 TiB which is way more than 1TB.
ncdu tool scanning my HD
- Next tried DiskDaisy and after analysis, it showed that there are 881GB of hidden files but I needed to pay and buy a licence to see the hidden files. It’s a premium feature.
DiskDaisy scan results on the free version
- Next tried CleanMyMac. It’s a nice software and has some free feature but it was only finding 7.5 GB of junk to clear. Things like app caches, unneeded download files and some more junk. I removed the IMovie through CleanMyMac since I don’t use it and that gave me another extra 2GB disk space.
CleanMyMac UI example — I did not save the actual one from my test
- Then tried the OmniDiskSweeper and when I ran the analysis It found 110GB of used disk space. Failed to see the hidden files. I used the GUI but apparently, you can use it as command line as well.
Install with HomeBrew using
brew cask install omnidisksweeper
OmniDiskSweeper UI example — I did not save the actual one from my test
Looking at Mac DiskUtility I could see the same info on disk space usage but no more info on what or where are those files.
Last hope was going back to DiskDaisy and purchasing a licence. Hoping it can show what are those hidden files finally. Good news! It worked and it showed that the hidden files are located under
private/var/tmp
and there they were!
DiskDaisy showing the hidden file in the premium version
Then after reading more on the forums, I found these are macOS temp files. Articles I read were primarily suggesting 2 solutions. 1- Restart your machine and macOS should get rid of temp files. 2- If the first solution does not work, start in safe mode and then restart in normal mode and that should remove the temp file. None of them worked for me. I even kept the machine in safe mode for a couple of hours to give the so-called macOS cleanup task enough of the time. Still no luck!
Then I used macOS built-in Disk utility in safe mode and the First Aid and hoping it can clean up any temp files. It did not find any errors and did not delete any files. So no luck here either!
Last resort was to manually delete the files. If you read on this manual deletion topic you will find a lot of ppl warning not to mess around with files in
private/var/folders
and alsoprivate/var/tmp
since they are managed by OS and can cause irreversible damage to files. Since I was out of options and HD space I relied on one article that was claiming removing temp files manually will not harm anything. I removed the files using DiskDaisy and freed up space. Then restarted and all looks good so far 🤞.
It took a good 40mins to remove all the files and my computer is alive. It was like choking the resources before. Disk space is one problem and also this issue was causing my BitDefender to go crazy and upload a lot to its server (I guess BitDefender does send some data about file for scanning to its server). So it was using a lot of bandwidth as well.
I still am not sure if what I did was right and if you should have manually deleted the temp files. The main question is why the OS didn’t clear out the temp files in that folder in the first place as expected. I will keep an eye on things in that area for the next few weeks and make sure it cleans up after itself.
The DiskDaisy licence did cost me AUD 15 and saved me a lot of time on this diagnosis. Also, I can use it on my other machines.
My machine is much faster now and I have not heard the fan sound today. BitDefender network activity is reduced significantly as well.
I was so focused on solving the issue and did not think about checking how old these files were or potentially try to find out if they belong to any specific programs which might have caused the issue.
So if you have more information on the macOS temp files, please share it here with me.
ps: I have used my machine for 5 days since and so far no signs of anything missing after the cleanup.