What is this file: Private->var->vm->sleepimage?

Discussion in 'macOS' started by rockinrocker, Feb 25, 2014.

  1. rockinrocker macrumors 65816

    rockinrocker

    Joined:
    Aug 21, 2006
    #1
    Can someone tell me what this is and if anything will happen if I delete it?
    It's taking up a pretty good chunk of my SSD.

    Thanks


    [​IMG]
     
  2. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #2
    That's for storing your system state (RAM) when you sleep the computer. Tough to tell in the picture. I think it says 17G. Do you have 16GB of RAM? That's why it's so large.
     
  3. rockinrocker thread starter macrumors 65816

    rockinrocker

    Joined:
    Aug 21, 2006
    #3
    Yep, sure do.

    I s'pose there's nothing to be done about it eating up that much space?
    Possible to off load it to another drive?
     
  4. jorgk, Feb 26, 2014
    Last edited: Feb 26, 2014

    jorgk macrumors member

    jorgk

    Joined:
    Mar 20, 2013
    #4
    Search for 'hibernate mode mac disable' or something like that. You can set this to 0 (in the terminal) and then delete the huge RAM-sleepimage file (as pointed out by mfram). The file should be as big as your RAM.
    Have a look for some background info (just picked via google) here.

    The only disadvantage is that if your laptop battery runs out of power while asleep, you will do a normal restart and loose everything that was only in RAM (unsaved windows etc.). With the hibernate file still there, OSX would restore the situation to as before, at the moment the system went to sleep.

    The advantage when having inactivated hibernation is that there's not each time 16 GB written to your SSD when you send the system to sleep. Because of being afraid of wear-out of their SSD, many change this setting accordingly.

    In brief:
    To set to No-hibernation (not writing RAM to disk when going into sleep), go to terminal and type:
    sudo pmset -a hibernatemode 0
    Confirm by typing your password (the cursor will not change), then press enter.
    If you feel to change back: Same command, but set it to 3.

    Once inactivated hibernation, you can delete the sleepimage file in /var/vm (In there will also be the swap files. I guess this is RAM swapped to disk - thus it should not be deleted).
     
  5. rockinrocker thread starter macrumors 65816

    rockinrocker

    Joined:
    Aug 21, 2006
    #5
    Thanks a lot for the detailed response.

    I think I will go ahead and disable this since I'm not really concerned about that feature.

    Sorry if this is a dumb question, but I've never done anything in Terminal before-

    So I type "sudo pmset -a hibernatemode 0"-
    should I leave a space or start a new line or anything before entering my password?

    Thanks
     
  6. Bruno09 macrumors 68020

    Joined:
    Aug 24, 2013
    Location:
    Far from here
    #6
    Launch the Terminal.

    Copy/paste : sudo pmset -a hibernatemode 0

    Hit the Enter key.
    The Terminal asks : "Password" ?

    Enter your admin password (won't show up, that is normal).

    Hit the Enter key.

    Now to check it worked :

    Copy/paste : pmset -g | grep hibernatemode

    Hit the Enter key.

    Answer should be : "hibernatemode 0".
     
  7. rockinrocker thread starter macrumors 65816

    rockinrocker

    Joined:
    Aug 21, 2006
  8. rockinrocker thread starter macrumors 65816

    rockinrocker

    Joined:
    Aug 21, 2006
    #8
    So if I wanted to return it to the default setting in the future I'm guessing I'd just enter that same command with the zero changed to a… 16 or something?
     
  9. jorgk macrumors member

    jorgk

    Joined:
    Mar 20, 2013
    #9
    No, I believe the default value is 3.

    You can check your system in this way: Open Terminal.app (in Utilities), type as shown here (pmset -g):

    MacXXXXXX:~ YourUserNameHere$ pmset -g
    Active Profiles:
    Battery Power -1
    AC Power -1*
    Currently in use:
    standbydelay 4200
    standby 0
    womp 0
    halfdim 1
    hibernatefile /var/vm/sleepimage
    gpuswitch 2
    sms 1
    networkoversleep 0
    disksleep 0
    sleep 45
    hibernatemode 0
    ttyskeepawake 1
    displaysleep 8
    acwake 0
    lidwake 0
    MacXXXXXX:~ YourUserNameHere $

    You see, I have inactivated hibernation (hibernate mode being 0) apart from other changes (e.g. I don't want that my Mac comes out of sleep just by opening the lid - that's done by lidwake set to 0).

    You can get some info on those things by typing: man pmset
    in terminal. To scroll through the output use arrows or the space bar. To leave the output just type q (quit).

    Hope that helps.
     
  10. rockinrocker thread starter macrumors 65816

    rockinrocker

    Joined:
    Aug 21, 2006
    #10
    Interesting.
    I didn't even know you could change that wake from sleep setting.
    That actually sounds like kind of a cool idea….
     

Share This Page