Is it possible to reduce the sleep image? (NOT remove it!)

Discussion in 'Mac Basics and Help' started by CFoss, Aug 1, 2012.

  1. CFoss macrumors 6502

    Joined:
    Feb 26, 2011
    #1
    With 16GB of RAM, the sleep image takes up a lot of internal memory. However, I do not want to get rid of the hibernation feature. Is it possible how much space the sleep image takes, without getting rid of it entirely?
     
  2. Stooby Mcdoobie macrumors 6502a

    Stooby Mcdoobie

    Joined:
    Jun 26, 2012
    #2
    Deleting the sleep image won't cause any problems because it will just be created again next time your Mac is put to sleep. I'm not sure if it's possible to reduce the size of it, though.
     
  3. GGJstudios macrumors Westmere

    GGJstudios

    Joined:
    May 16, 2008
    #3
    The only way to reduce the size is to reduce the amount of RAM, as the sleepimage is a copy of your RAM contents.
     
  4. CFoss thread starter macrumors 6502

    Joined:
    Feb 26, 2011
    #4
    I figured this was the case. Okay, thank you for your help.
     
  5. Blue Sun macrumors 6502a

    Joined:
    Feb 11, 2009
    Location:
    Australia
    #5
    I've had my sleep image disabled for over a year on my MBP with an aftermarket SSD. It hasn't affected me in the slightest, save for the additional 8GB on my drive.

    AFAIK, the only time it could become a problem is when the battery reaches complete depletion, as the machine would be unable to restore the state it was in prior to shutdown.

    Below are some Terminal commands relating to the sleep image.

    To view sleep image size:
    ls -lh /private/var/vm/sleepimage

    To prevent the creation of the sleep image:
    sudo pmset -a hibernatemode 0

    To delete the sleep image (thus regaining HD space):
    sudo rm /private/var/vm/sleepimage

    I can confirm that the above commands work for both Lion and Mountain Lion.
     
  6. CFoss thread starter macrumors 6502

    Joined:
    Feb 26, 2011
    #6
    Thank you. I actually prefer to have that backup, so I'm going to leave the sleep image there. On the Windows partition, I have disabled the hiberfil.sys, as the extra 16GB of space is more valuable on a 40GB partition than resuming progress of a video game, etc.
     
  7. Stooby Mcdoobie macrumors 6502a

    Stooby Mcdoobie

    Joined:
    Jun 26, 2012
    #7
    Thanks for this. I also have 16 GB of RAM and a SSD, so this command will give me that crucial space back.
     

Share This Page