How to disable sleep image creation

Every time after I boot/reboot my Mac there is a 'sleepimage' file in private/var/vm that I have to manually trash. I never sleep my Mac, it's either on or off. This sleepimage file takes up 35GB of space and as I run my OS from an SSD this is space that I need. I did not have this issue on 10.8 but has been persistent on 10.9 even after a clean install. How can I disable the creation of this file permanently or fix OS X so that the file is only created when it should be (when I put the Mac to sleep)?


Thanks!

Mac Pro, OS X Mavericks (10.9), 12-Core 3.06, 64GB RAM, SSD & 14TB

Posted on Nov 21, 2013 4:21 PM

Reply
5 replies

Nov 24, 2013 8:22 PM in response to John Galt

Here's the complete output in case it contains other information that may help. Could it have something to do with the UPS battery backup I have connected? The Mac is set to auto-power down when there is 20% battery left. This shut down is very fast compared to normal shutdown sequence so maybe it dumps the RAM to disk real quick? If so then I'd expect the sleepimage to be there after a power outtage but not during normal restart/shut down.. just thinking out loud.


In case the com.apple.serve mentions are relevant, I have OS X Server app installed (no services enabled).


Active Profiles:

UPS Power -1

AC Power -1*

Currently in use:

hibernatemode 3

womp 1

networkoversleep 0

sleep 0 (sleep prevented by UserEventAgent, com.apple.serve, com.apple.serve, com.apple.serve, com.apple.serve, com.apple.serve, com.apple.serve, com.apple.serve, AddressBookSour)

Sleep On Power Button 0

ttyskeepawake 1

hibernatefile /var/vm/sleepimage

autorestart 1

disksleep 10

displaysleep 10

Nov 24, 2013 9:48 PM in response to jayv.

hibernatemode = 3 is appropriate for portable Macs, and will write sleepimage to disk so that a battery-powered Mac can remove power to RAM while it sleeps for power conservation. That is the reason for the sleepimage file creation. It's not related to using a UPS, which you can configure to sleep or shut down the Mac at programmed limits of time or battery charge. There is no difference to the Mac - it will either sleep or shut down in the same exact manner, with or without a UPS.


If a desktop loses power the sleepimage file is not used to restore RAM upon a subsequent startup. Although the sleepimage file is being written to disk every time your Mac sleeps, it can convey no benefit, so hibernatemode should be set to zero.


I believe you can reset hibernatemode to its default value of zero by resetting the NVRAM.


NVRAM reset:


  1. Shut down your Mac.
  2. Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
  3. Turn on the computer.
  4. Press and hold the Command-Option-P-R keys before the gray screen appears.
  5. Hold the keys down until the computer restarts and you hear the startup sound for the second time.
  6. Release the keys.


If that does not reset it to zero use Terminal:


sudo pmset -a hibernatemode 0


There are also third party hacks and utilities to manipulate system sleep variables that may have caused it to change from the zero value that it should have been. I don't recommend using such things.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to disable sleep image creation

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.