beta.blog

MAC OS X: Disable SleepImage

by on Oct.10, 2014, under MAC OS X

If you ever used disk diagnostic tools such as DaisyDisk you might have noticed there’s a file of equal size to your machine’s inbuilt RAM. This file is being created due to the hibernate mode when your MAC goes into sleep mode and contains the content of your RAM.

Since I frequently ran low on available HDD space I used to delete this file like this:

sudo rm /private/var/vm/sleepimage

However, the file was still rebuilt by the system. Thus I decided to search for a permanent solution and I found this could be accomplished by changing the hibernate mode from 3 to 0.

Default value: 3

pmset -g | grep hibernatemode

Value to disable the sleep image entirely: 0

sudo pmset -a hibernatemode 0

If it still gets created you may also delete the sleep image, create a blank file and make it immutable like this (workaround):

sudo rm /private/var/vm/sleepimage
sudo touch /private/var/vm/sleepimage
sudo chflags uchg /private/var/vm/sleepimage

2 Comments for this entry

  • Bill

    Hi,

    Ran across this post while looking into hybernatemode and sleepimage.

    I’m sleuthing around trying to find a fix for a fail-to-wake problem with OSX 10.9.5.

    If I set hibernatemode to 0, then delete sleepimage, will it be rebuilt if/when I change hibernatemode back to 3?

    I’m thinking of doing this to see if I can resolve a fail-to-wake problem with my MBP.

    Thanks,

  • Bill

    As a followup,

    my sleepimage file shows a location /var/vm/, not
    /private/var/vm/

    Do you know if it is safe to delete sleepmode in /var/vm after issuing the command sudo pmset -a hibernatemode 0 and will sleepmode rebuild with sudo pmset -a hibernatemode 3? OR…

    only delete the sleepmode in /private/var/vm?

Leave a Reply

*

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!