On my laptop with macOS Sierra 10.12.5 (but it was happening with previous versions of the OS too), I get pinged by the system that I have only a few GBs left, I clean up, reboot, go from 4 GB left to 30 GB left, and within a couple of days, not doing anything special (not downloading movies or anything space-hungry), I get told again I have only 4 GB left ... I went through that cycle a few times now, and I'm wondering what could be causing that behavior, and how I could stop it. Any idea or pointers to what I should look at on my HDD to try and understand this? (sleep images, sparse bundles...)

Note: this question is not about using a disk inventory app to find the large files that take up too much space on my HDD. What I am interested in is why I got from 30 GB after boot to 4 GB without installing anything on my Mac. I want to understand which process is doing that and stop it.

  • do you have Photos app set up to sync photos across devices? – wrossmck Jun 12 '17 at 16:24
  • 1
    Possible duplicate of How can I figure out what's slowly eating my HD space? – Allan Jun 12 '17 at 16:29
  • No Photos app - I actually don't use Photos on that machine. – Frank Jun 12 '17 at 16:35
  • What model of MacBook do you have and how much RAM do you have installed? – Alistair McMillan Jun 12 '17 at 17:31
  • @AlistairMcMillan - This is MBP retina 15 inch, 2.5 GHz, Core i7, mid 2014 w/ 16 GB 1600 MHz DDR3. – Frank Jun 12 '17 at 20:04

To get a convenient du-diff tool, install brew which requires Command Line Tools (CLT) for Xcode or Xcode, from within brew links (brew install links) and finally download and unzip gt5.

gt5 is a shell script which can either be run directly from its current dir or you can move it to a directory in your PATH (echo $PATH). Make the script executable if necessary.

Make a temp gt5 dir: mkdir ~/.gt5-diffs Run the script with:

sudo ~/Downloads/gt5-mac/gt5 / --cut-at 0.01 --max-depth 10 --diff-dir ~/.gt5-diffs

After running the script two times with a ∂t of eight minutes I get the following result:

 gt5 v1.4.0 (host:/):   [cut:0,01% depth:10 lines:10000]                                                                 
  last check was on Mo Jun 12 19:40:13 CEST 2017 (i.e. 0d, 00:08:10 ago)                                                             


 ./:   [221GB in 11 files or directories]  +708KB                                                                                    

  176GB [79,35%] ./Share/                                                                                                            
   16GB [ 7,01%] ./Applications/                                                                                                     
   15GB [ 6,93%] ./Users/  +568KB                                                                                                    
  4,8GB [ 2,16%] ./System/                                                                                                           
  3,6GB [ 1,64%] ./Library/                                                                                                          
  3,5GB [ 1,59%] ./private/  +140KB                                                                                                  
  2,5GB [ 1,13%] ./usr/                                                                                                              
  386MB [ 0,17%] ./opt/     

After modifying the gt5 options (e.g. increase depth and/or lines)/dir and running the script several times you will get the culprit eating your disk space.

Due to the limitation of the --cut-at option to 0.01, folders with a size smaller than 0.01 percent of the total size of the superior folder aren't shown. In the above example that's / with 221 GiB: folders in the root folder with a total size smaller than 22.1 MiB won't appear (the sizes are base2 and not base10!). --cut-at defaults to 0.1 and can be adjusted between 0.01 and 30.

  • I'm going to try and do that. Will take me a little bit of time to set up and run. Sounds promising though. – Frank Jun 12 '17 at 22:24
  • In the end, it was a combination of gradle caches, IDEA caches, iTerm2 caches, and some other automated backups I have setup in other applications. gt5 was the way to figure that out. Thanks Klanomath! – Frank Jun 16 '17 at 14:40

Install Homebrew (www.brew.sh) In the teminal, use this command to install ncdu

brew install ncdu

then, run it

cd ~; sudo ncdu

You will get a nice overview of the size of all folders in your home directory, largest topmost. It should be easy to track your gigabytes.

If this does not give results, you can run ncdu for your whole disc as well. Just go to /Volumes/DISKNAME e.g.

cd /Volumes/MACBOOT; sudo ncdu

You should also make sure that no application is simply "eating ram" by running

top -o mem

In the top lines, if there are applications that have a "G" in the "mem" column, they use gigabytes of ram. Make sure this is adequate. You might have an application with a memory leak installed.

  • for a graphical view, use Disk Inventory X: derlien.com/downloads/index.html – wrossmck Jun 12 '17 at 16:26
  • I have looked at disk inventory apps - I can see where space is spent, yes, BUT that is not quite the problem. The problem is that upon clean-up and reboot, I have 30 GB available, and without doing much of anything that I can tell would take up space, after a couple of days I'm down to 4 GB. And if I reboot, I'm back to 30 GB - it seems to be something dynamic that the system is doing rather than something I store myself on the HDD (?) – Frank Jun 12 '17 at 16:37
  • Then, which folder grows? Doesn't have to be you user folder, just give us a hint where the problem might lie... – user2707001 Jun 12 '17 at 17:05
  • Sounds like swapping to me. Maybe some application with a memory leak that is running? – user2707001 Jun 12 '17 at 17:10
  • Try "top -o mem" in the Terminal. Anything with a "G" in the mem column of the top lines? – user2707001 Jun 12 '17 at 17:13

I like using ncdu as @user2707001 recommended in their answer, and for a graphical view, I like using DaisyDisk.

You must log in to answer this question.

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