Possible Duplicate:
Why does Finder use 59GB of swap space?

So I have a regular (fresh) install of OSX Lion on my 2009 MBP, and I installed an SSD as the primary HDD prior to installing Lion. It's a 128GB SSD drive, but the system is using 52.6GB of this for it's swap files, which regularly results in zero space remaining on the drive and the system locking up.

See this visualisation

Any idea why it would be using so much space for this (please see the visualisation screenshot, above)?

marked as duplicate by nohillside, bmike Dec 3 '12 at 18:01

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    What applications do you have always running? – Nicholas Smith Sep 26 '11 at 10:33
  • 2
    Since the system won't actually delete a file while the file handler is open, you can navigate to /private/var/vm and rm ./swap* and reboot. You should be able to see if it was a one time thing, or something is really leaking memory so badly that the system responds by swapping out massive amounts of data. You might also check the dates on these files to see if it's a "failed to clean up" scenario and not a "currently happening" issue. – bmike Sep 27 '11 at 14:48
  • 3
    Instead of editing your answer into the question, you should submit an actual answer on your question and accept it. Assuming you feel at this point the changes you made resolved your problem. – Jason Salaz Sep 27 '11 at 15:30
  • @bmike I am not sure that is true of 'rm' (that it won't delete a file while the handler is open). Finder may check, but I think 'rm' is happy to delete anything it can get its hands on. – TJ Luoma Sep 28 '11 at 3:59
  • I've done that move (rm on swap) on servers and desktop macs without fail since 10.3 days to no ill effect. It's very likely true for rm in general - but if not, then the dynamic_pager is certainly smart enough to handle things with root/admin deleting swap files while the system runs. rm just removes the directory entry so no new processes can find the file - the running files already have that file mapped so actual removal happens when these references expire. – bmike Sep 28 '11 at 18:31

The Original Poster explained that the answer was as follows:

I killed Sequel Pro that was using 2GB of RAM, and then ran:

$ sudo periodic daily weekly monthly

This had the effect (correct if wrong) of running some tasks which cleaned up the swap files. I now have between 30GB and 50GB space remaining (it's fluctuating..)

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