9

My new retina MacBook Pro(with 16GB RAM) keeps receiving this "Your Mac OS X startup disk has no more space available for application memory" message. I have 300 GB of free space on my hard drive, and 16 GB of RAM. This shouldn't be happening.

But it keeps happening, even when I'm not actively using my Mac. I went to lunch, came back, and saw this: too much RAM usage 59 GB of swap used.

What is going on?

9
  • 1
    Can I assume that you've tried rebooting? Jul 17, 2012 at 17:37
  • Yup, I've rebooted and it fixes the immediate issue but it will pop up again eventually. Jul 17, 2012 at 17:41
  • 2
    If you disconnect from the network and then reboot in safe mode, does Finder not require as much RAM? Next (if needed), repeat again after Time Machine and all external drives are disconnected. This could be normal behavior based on the work you have given Finder, so it's hard to know where the "too much" RAM usage line lies until you have quantified the environment where Finder is running. If you don't mind poking in log files, run sysdiagnose on Finder - you'll have a dump of all memory allocations and much more to examine.
    – bmike
    Jul 17, 2012 at 17:50
  • Sounds like a weird bug, but the only possible solution that I could think of would be to try a clean install. I'll be interested to see if anyone else has experienced this. Jul 17, 2012 at 17:51
  • 1
    It sound like memory leak. you should repport it to apple. Jul 18, 2012 at 9:11

2 Answers 2

7

I believe this is a bug in OS X 10.7. I also have a retina MacBook Pro. Mine is 2.6/16/512, and I noticed that there were 0 page outs but a very large swap file being created (mine was about 8 GB). Closing applications actively reduced the swap space being used. Again there were no page outs being recorded.

I believe this has to do with the sleep image file that also gets housed alongside the virtual memory files in /private/var/vm. When pmset hibernatemode is set to 3 (default for laptops, suspend to RAM and disk), sleepimage gets written upon sleep. This is why it takes a few moments for these laptops to go to sleep: it's writing up to 16 GB of RAM to the sleepimage.

However, changing this setting so that the RAM gets powered on sleep and NO sleepimage is written has resulted in no abnormal increases in swap file size. My suspicion is that the sleepimage is in some cases being preserved post-sleep and prompting the creation of swap files. Perhaps it is this incorrect behavior that is also resulting in the unusually large swap file sizes you are seeing.

From the manpage for pmset, to change to NO suspend to disk you would run in a Terminal:

sudo pmset -a hibernatemode 0

To delete the sleepimage (and reclaim 16 GB on your computer with 16 GB of RAM), run:

sudo rm /var/vm/sleepimage

I restart after these operations just to ensure there's no weirdness. On each power source, you can check the status with:

pmset -g

You should be aware that, in the event of a total power loss (battery dies and not plugged in) the contents of the RAM will not have been saved to the hard drive, and you will lose your work. For me, this is a small but calculated risk because the speed of sleep/wake, coupled with the great battery life and reclaimed storage space. Additionally, for me it seems to have mitigated this issue, which I have not seen on any other Mac laptop I've owned. I wish we had those battery indicator lights, though.

4
  • I believe the bug has been fixed. I haven't seen this happen since the latest ML patch, at least. Aug 6, 2012 at 14:56
  • I have the latest ML build on a rMBP and I still see this issue.
    – Marc W
    Sep 15, 2012 at 18:36
  • I'm not so sure this is a bug in the OS as much as how swap works when you run other software with memory leaks and don't reboot enough to keep the swap files under control.
    – bmike
    Dec 3, 2012 at 18:05
  • @bmike I'm inclined to agree, although previous versions of the OS did not have this issue on other machines. I have also not seen any verified reports of this specifically on non-retina MacBook Pros running the same OS, though they may exist. Dec 5, 2012 at 18:43
2

I had this issue due to a bug in Dropbox on my MacBook Pro 13 inch.

It was a old version of Dropbox. After quitting Dropbox and installing a new version (1.4.1 -> 1.4.17), my problem was fixed.

You must log in to answer this question.

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