Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I've been having this problem for quite a while and it happens occasionally and when it does it get very frustrating and I'm just trying to pin point what is causing it.

When it happens, the disk space gets exhausted all the way to 0 bytes available and when that happens, I can't even surf. But magically after a while, the disk space frees itself and I get my disk space back as shown below (copy pasted from console: look at /dev/disk0s2).

  • In a span of 5 minutes, 1GB to 0 free space.
  • After another minute I get my 1GB back. I have no Time Machine backups going (don't even have it configured), no Dropbox or other only syncing apps running and I don't think I'm doing anything out of the ordinary when it happens.

What would be the best way to track what is grabbing the disk space and later releasing it?

  • OS X 10.9.3
  • Macbook Pro (13", Mid 2009)

Console log:

elmaco:test thewheat$ date && df -h
Sun  8 Jun 2014 10:55:01 EST
Filesystem      Size   Used  Avail Capacity    iused      ifree %iused  Mounted on
/dev/disk0s2   232Gi  231Gi  1.0Gi   100%   60644234     264996  100%   /
devfs          219Ki  219Ki    0Bi   100%        756          0  100%   /dev
map -hosts       0Bi    0Bi    0Bi   100%          0          0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%          0          0  100%   /home

elmaco:test thewheat$ date && df -h
Sun  8 Jun 2014 11:00:21 EST
Filesystem      Size   Used  Avail Capacity    iused      ifree %iused  Mounted on
/dev/disk0s2   232Gi  232Gi  6.7Mi   100%   60907509       1721  100%   /
devfs          219Ki  219Ki    0Bi   100%        756          0  100%   /dev
map -hosts       0Bi    0Bi    0Bi   100%          0          0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%          0          0  100%   /home

elmaco:test thewheat$ date && df -h
Sun  8 Jun 2014 11:01:23 EST
Filesystem      Size   Used  Avail Capacity    iused      ifree %iused  Mounted on
/dev/disk0s2   232Gi  232Gi    0Bi   100%   60909230          0  100%   /
devfs          219Ki  219Ki    0Bi   100%        756          0  100%   /dev
map -hosts       0Bi    0Bi    0Bi   100%          0          0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%          0          0  100%   /home

elmaco:test thewheat$ date && df -h
Sun  8 Jun 2014 11:02:22 EST
Filesystem      Size   Used  Avail Capacity    iused      ifree %iused  Mounted on
/dev/disk0s2   232Gi  231Gi  1.0Gi   100%   60647784     261446  100%   /
devfs          219Ki  219Ki    0Bi   100%        756          0  100%   /dev
map -hosts       0Bi    0Bi    0Bi   100%          0          0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%          0          0  100%   /home

Activity Monitor - Disk Tab

Update 1: So I've deleted some files so I have 6GB+ free and restarted but the behaviour still exists. I thought it could also be the swap file growing, but it stays consistently at 1GB when no space is available. Now I find this a bit strange as I have upgraded my RAM to 8GB for over a year now and I thought OSX would auto allocate the appropriate amount for the swap file and I don't recall ever doing anything to modify/restrict swap file sizes.

Is there a way to track what could be trying to grab 6GB of data and later free it? Or any log file that would help track this down?

elmaco:vm thewheat$ date && df -h
Sun  8 Jun 2014 13:31:46 EST
Filesystem      Size   Used  Avail Capacity  iused   ifree %iused  Mounted on
/dev/disk0s2   232Gi  232Gi    0Bi   100% 60909230       0  100%   /
devfs          205Ki  205Ki    0Bi   100%      708       0  100%   /dev
map -hosts       0Bi    0Bi    0Bi   100%        0       0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%        0       0  100%   /home
/dev/disk0s7   136Gi   50Gi   79Gi    39%   251098 8817446    3%   /Volumes/Untitled 1

elmaco:vm thewheat$ date && df -h
Sun  8 Jun 2014 13:34:47 EST
Filesystem      Size   Used  Avail Capacity  iused   ifree %iused  Mounted on
/dev/disk0s2   232Gi  232Gi    0Bi   100% 60909230       0  100%   /
devfs          205Ki  205Ki    0Bi   100%      708       0  100%   /dev
map -hosts       0Bi    0Bi    0Bi   100%        0       0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%        0       0  100%   /home
/dev/disk0s7   136Gi   50Gi   79Gi    39%   251098 8817446    3%   /Volumes/Untitled 1

elmaco:vm thewheat$ date && df -h
Sun  8 Jun 2014 13:36:40 EST
Filesystem      Size   Used  Avail Capacity  iused   ifree %iused  Mounted on
/dev/disk0s2   232Gi  226Gi  6.2Gi    98% 59272640 1636590   97%   /
devfs          205Ki  205Ki    0Bi   100%      708       0  100%   /dev
map -hosts       0Bi    0Bi    0Bi   100%        0       0  100%   /net
map auto_home    0Bi    0Bi    0Bi   100%        0       0  100%   /home
/dev/disk0s7   136Gi   50Gi   79Gi    39%   251098 8817446    3%   /Volumes/Untitled 1

Activity Monitor - Memory Activity Monitor - Disk

Update 2: So clearing up ~12GB of drive space managed to resolve the issue (now says 11GB free). My swap file is still 1GB so there isn't more space allocated to that.

That weird behaviour of eating up 6GB after a reboot is still perplexing, so I'm still curious to know what exactly was utilising the disk and would accept answers if I am able to recreate the scenario and see what exactly is requesting the space.

share|improve this question
3  
Is there a reason why you can't allow 5 GB of free space on the drive? All systems tend to get a little pathological when the OS can't even move files around. You'll also want to post the memory details from Activity monitor as it will allow us to determine swap file usage. –  bmike Jun 8 at 2:42
    
Managed to free up 6GB+ free space and problem still persists. Memory and Disk usage after the restart have been added –  thewheat Jun 8 at 3:50
2  
Based on your virtual memory usage (8.77GB) I would try to free up a few more GB and your disk space won't drop to 0. You want some space as buffer. If it were my machine, I'd shoot for keeping 20GB free with those numbers. –  dwightk Jun 8 at 5:54
    
Have you a hibernate file? (but still on a 230G disk you should have more free) –  Mark Jun 11 at 11:04
    
Updated yet again, clearing disk space solved the problem I was having but I am curious to know what exactly was requesting the disk space especially with it still occurring at 6GB free space and my swap file not increasing in since freeing up the space –  thewheat Jun 13 at 2:03

2 Answers 2

If you are saying you have 1GB of free memory then the problem is not what is grabbing that 1GB but the lack of memory in the first place.

This will get worse overtime because you are already hitting 0 bytes and operating system needs space to write out its files.

I strongly suggest you move essential files like photos a video media off to an external drive to free up some memory. These type of files being normally the largest and easiest to move. ( Do not delete any system files unless you know exactly what they are and removing them will not break you system)

Try and give yourself at least 10-15% free space as a minimum and keep at or above that.

share|improve this answer
    
Based on this I investigated the swap file and was surprised to see that it is only 1GB (even though I have 8GB RAM). Also after freeing up 6GB, the same problem persisted. –  thewheat Jun 8 at 3:52

kernel_task is doing that when it is paging out contents of RAM to disk.

Based on your virtual memory usage (8GB+ also written to your disk) you are going to want to keep at least 12GB of space free on your startup disk.

OS X uses virtual memory when it runs out of RAM, which means it moves some stuff from RAM to your disk and that is what is filling up the last bit of space.

share|improve this answer
    
Yeah I managed to free up 6GB+ but the problem still persists. Updated details in my question –  thewheat Jun 8 at 3:54

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.