MacOS – Why OS X says a low free space, despite having 25GB free

disk-spacemacos

I've the following entry in log:

24/08/2015 18:00:32.197 com.apple.mtmd[55]: attempting to thin because of low free space on Macintosh HD (/) by removing 2015-08-24 16:57:54 +0100, estimate 0 bytes to recover, 1 snapshot can be thinned

But I've over 25GB free:

$ df -h
Filesystem                         Size  Used Avail Use% Mounted on
/dev/disk0s2                       466G  442G   24G  95% /

In top:

Load Avg: 2.39, 3.67, 3.70  CPU usage: 8.71% user, 6.5% sys, 85.22% idle  SharedLibs: 9592K resident, 9392K data, 0B linkedit. MemRegions: 223410 total, 6136M resident, 53M private, 798M shared. PhysMem: 11G used (5491M wired), 272M unused.
VM: 1131G vsize, 1066M framework vsize, 18083888(372) swapins, 21344621(0) swapouts. Networks: packets: 10086831/7650M in, 8482767/3357M out. Disks: 11688769/221G read, 9345680/217G written.

$ top -l 1 | head -n 10 | grep PhysMem
PhysMem: 11G used (5536M wired), 74M unused.

And vm_stat:

$ vm_stat 1
Mach Virtual Memory Statistics: (page size of 4096 bytes)
    free   active   specul inactive throttle    wired  prgable   faults     copy    0fill reactive   purged file-backed anonymous cmprssed cmprssor  dcomprs   comprs  pageins  pageout  swapins swapouts
   48498   739133     2327   684917        0  1405393    17258 1682134K 20168887 2191469K  339740K 14307441      170267   1256110  6862590  1312575  192808K  223457K  172163K  1539229 18095123 21344621 
   48373   738368     2327   684917        0  1406527    17258     2018      226      627        0        0      170267   1255345  6862359  1312573      231        0        0        0        0        0 
   47801   739664     2333   684909        0  1405395    17268     1576        0      922        0        0      170273   1256633  6862196  1312573      163        0        1        0        0        0 

I believe this state of a low free space breaks few apps (like Chrome) which behaves weird.

Why OS X is saying it is out of free space (low free space) on / when it has a lot of it? Is it some kind of bug?

Best Answer

25GB is not alot of space on a nearly 500GB drive. It seems that OSX has a built-in alert for 5%.

Recall that the operating system needs to rely on the drive being available to manage conditions where there may not be enough memory to complete processes. This is what we call 'virtual memory'. OSX will swap older memory items to the hard drive if needed.

In addition, OSX wants enough space to provide the ability to write all of current memory to the hard drive in case of a power issue, so that you do not lose data due to battery issues. In this case, it needs at least enough space to ensure it can write 4GB/8GB/16GB depending on your RAM size.

All of these items are managed by the OS, and if it detects a condition where it may not be left with enough space on the hard drive to perform its functions, it will alert you the user.