11

Since I upgraded to macOS High Sierra, one week ago, I have noticed that each time I wake the computer from sleep, the space left on the drive have decreased by a, somewhat, random amount.

I have very little free space on my drive - too little actually - so I usually keep an eye on it during each session I'm using the computer.

My first notice was that the assumed left space of about 6GB was only about 5. The day after the space was down to ~150MB! I did some cleanup, removed Xcode derived data, cleaned out cashes etc, and restarted. I think I got back to about 3-4GB.

Fast forward to the day before yesterday. Then I cleaned out a lot of junk and I had about 17GB of free space. Yesterday I only had just below 16GB, and today I only have ~10GB. After a reboot I got 12.5GB, but I also removed about maybe a 500MB yesterday, so I should at least have more than 16GB if everything was working the way I was expecting it.

What I have tried to 'solve' the problem is to see if closing apps increases the space - and it does - but not that much so I regain all 'lost' space. I also cleaned out cashes and Xcode derived data. But since I did this the first time, there is usually not much of a gain here.

I have a MBP Retina, i7, with 16GB of memory and ~500GB of disk. The computer is from 2013, I think. I regularly use Xcode, Safari, iTunes, Messages. Sometimes also Affinity Photo, Aurora HDR, Luminar and qbittorrent.

Searching on google, it seems like I'm the only one having this kind of problem. Or is there someone else having similar issues with decreasing space on the drive?

All help on this issue is welcome!

1
  • Now, almost a month later, I can tell that what I have seen is that the free disk space is still varying on day-to-day basis, but over a longer time it is quite stable. Previously I was afraid the system lost HD space somehow, but no more. Comparing an APFS macOS system to an old HFS+ one, the lessons I learned it to have more free space on the drive - since the system is having these variations...
    – mberg
    Commented Nov 12, 2017 at 8:47

2 Answers 2

2

In my experience, there are two major culprits for this unexplained disk usage:

  1. Time machine
  2. Swap

One possibility is time machine. If you open Disk Utility, you may see a section labelled "Other Volumes", these are likely to be time machine backups. If you do see this, then you can open a command shell and enter:

df -h

On my machine, I get output similar to:

Filesystem                                                             Size   Used  Avail Capacity   iused               ifree %iused  Mounted on
/dev/disk1s1                                                          465Gi  442Gi   18Gi    97%   5512606 9223372036849263201    0%   /
devfs                                                                 196Ki  196Ki    0Bi   100%       678                   0  100%   /dev
/dev/disk1s4                                                          465Gi  5.0Gi   18Gi    23%         5 9223372036854775802    0%   /private/var/vm
map -hosts                                                              0Bi    0Bi    0Bi   100%         0                   0  100%   /net
map auto_home                                                           0Bi    0Bi    0Bi   100%         0                   0  100%   /home
map -fstab                                                              0Bi    0Bi    0Bi   100%         0                   0  100%   /Network/Servers
com.apple.TimeMachine.2017-10-19-174031@/dev/disk1s1                  465Gi  428Gi   18Gi    97%   5078237 9223372036849697570    0%   /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/Smakolyk/2017-10-19-174031/Smakolyk
com.apple.TimeMachine.2017-10-19-072101@/dev/disk1s1                  465Gi  423Gi   18Gi    97%   3858374 9223372036850917433    0%   /Volumes/com.apple.TimeMachine.localsnapshots/Backups.backupdb/Smakolyk/2017-10-19-072101/Smakolyk

Here you can see that I have local two time machine backups, and these will be using space. Apple have more information about local time machine backups.

You can disable local snapshots with:

sudo tmutil disablelocal

This should turn off the feature and free up the space. You can turn it back on with

sudo tmutil enablelocal

The second option is swap, this you can most easily see in /var/vm:

$ ls -lh /var/vm
total 10485760
-rw------T  1 root  wheel   1.0G  9 Oct 08:30 sleepimage
-rw-------  1 root  wheel   1.0G 18 Oct 14:00 swapfile0
-rw-------  1 root  wheel   1.0G 18 Oct 15:09 swapfile1
-rw-------  1 root  wheel   1.0G 19 Oct 21:25 swapfile2
-rw-------  1 root  wheel   1.0G 19 Oct 09:11 swapfile4

As you can see, I have 4GB in swap on my machine, and this is also taking up space on the disk.

4
  • Thanks for a thorough answer! Since I'm not using Time Machine it leaves us with the Swap, I guess. But shouldn't the Swap be more stable in size(s)? I know that some apps consume much disk space (Swap?) while working on them. But If I use apps in a way that I have done before High Sierra, and it by that time didn't increase its disk space usage in a un-normal way - it should perhaps be in a similar way now - which it isn't. And even if the disk space usage change for my apps, I would regain that space after a reboot...
    – mberg
    Commented Oct 21, 2017 at 7:25
  • @mberg My swap regularly moves from 4-8gb and back. Your situation may well be different though. Commented Oct 21, 2017 at 23:00
  • yes, but even if the swap file moves in size like yours, shouldn't it be reset to some default size on reboot?
    – mberg
    Commented Oct 24, 2017 at 17:27
  • @mberg yes, on reboot they are typically reset to zero size or deleted. Commented Oct 24, 2017 at 18:53
0

I had a bunch of these time machine local mounts sitting around as well. I just "entered time machine" browsed back a few days then exit. After a few minutes Time Machine cleaned out all the older mounts (it created a bunch of new ones for a while, too).

You must log in to answer this question.

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