sleepimage just 1 GB insize by 16 GB RAM?

Discussion in 'MacBook Pro' started by boppin, Dec 10, 2017.

  1. boppin macrumors regular

    Joined:
    Jun 14, 2008
    Location:
    Germany
    #1
    Hello!

    Today I've noticed that my OSX sleepimage is just 1 GB in size while having16 GB of RAM.

    Is this normal to the Retina Macbooks or is my system damaged?

    I am confused.
     
  2. Samuelsan2001 macrumors 604

    Joined:
    Oct 24, 2013
    #2
    What are you confused about? it needed 1gb to save the information you were using and the computer configuration sleep image before it slept that's all.
     
  3. evec macrumors regular

    Joined:
    Jun 8, 2016
    #3
    It will expand size and resize back to 1GB after sleep.
     
  4. boppin thread starter macrumors regular

    Joined:
    Jun 14, 2008
    Location:
    Germany
    #4
    That's interesting because my white 2009 Macbook has 8 GB of RAM but uses an 4 GB sleepimage running on Sierra.

    My old 2011 MBP had 8 GB of RAM and also used a sleepimage in 4 GB of size. (When it had 16 GB, the sleepimage was 8 GB)

    So I was wondering that my 2012 Retina MBP just uses 1 GB.
     
  5. evec macrumors regular

    Joined:
    Jun 8, 2016
    #5
    The mechanism of sleepimage have been changed for SSD optimize
     
  6. boppin thread starter macrumors regular

    Joined:
    Jun 14, 2008
    Location:
    Germany
    #6
    Hello evec!

    Thanks for your reply!

    This explains everything. Thank you!

    But this applies to Apple OEM SSD only, right?
     
  7. Fishrrman macrumors P6

    Fishrrman

    Joined:
    Feb 20, 2009
    #7
    With my MacBook Pro's, I DISABLE the sleep image using terminal:
    sudo pmset -a hibernatemode 0

    Then, I DELETE the existing image:
    sudo rm /private/var/vm/sleepimage

    Next, I create a NEW, "empty" sleep image:
    sudo touch /private/var/vm/sleepimage

    Finally, I "lock" the new image, so that it cannot be changed by the OS:
    sudo chflags uchg /private/var/vm/sleepimage

    Now, the sleep image is disabled, and cannot "grow in size" since it's locked "as a new, small file".

    As you might have guessed, I don't care about having a sleep image, and I DON'T want it messing with my MacBooks!
     
  8. boppin thread starter macrumors regular

    Joined:
    Jun 14, 2008
    Location:
    Germany
    #8
    One thing I don't absolutely understand.

    Before going to sleep there 10 GB RAM in usage; going to sleep. After wake there were over 3 GB in swap! Why?!

    Never seen this on my 2011 MBP or my white MacBook.
     
  9. evec macrumors regular

    Joined:
    Jun 8, 2016
    #9
    Are you mean your sleepimage file size ? It just normal.

    Please notice that OS will create 1GB file size not mean it should require to write 1GB data in SSD, it can be just hold 1GB.

    As Apple balance of SSD life and battery, nowadays the memory image will not save to disk immediately, it only save to disk unplugged of external power supply and when use battery after few hours or battery very low.
     
  10. boppin thread starter macrumors regular

    Joined:
    Jun 14, 2008
    Location:
    Germany
    #10
    no, I am talking about the swap usage.

    before sleep, no swap, after sleep several GB.
     
  11. Fishrrman macrumors P6

    Fishrrman

    Joined:
    Feb 20, 2009
    #11
    OP wrote:
    "before sleep, no swap, after sleep several GB..."

    With 16gb of RAM, you could -try- disabling VM disk swapping by using this terminal command:
    sudo launchctl unload -wF /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist

    Then use this command to remove the swap file:
    rm /var/vm/swapfile*

    I'd try that, and run that way a few days.
    If you start getting crashes, it's easy enough to RE-ENABLE swapping with this command:
    sudo launchctl load -wF /System/Library/LaunchDaemons/com.apple.dynamic_pager.plist

    Personal experience:
    I've been running with VM swap DISABLED for a couple of years now, without a single crash.
    This is on a 2012 Mini, 10gb RAM, OS 10.11.6.
    I -do- quit apps I don't need, and don't load up browsers with dozens of pages...
     
  12. boppin thread starter macrumors regular

    Joined:
    Jun 14, 2008
    Location:
    Germany
  13. boppin thread starter macrumors regular

    Joined:
    Jun 14, 2008
    Location:
    Germany
    #13
    Now I am reinstalling the system from a clean disk.
     
  14. boppin, Dec 23, 2017
    Last edited: Dec 23, 2017

    boppin thread starter macrumors regular

    Joined:
    Jun 14, 2008
    Location:
    Germany
    #14
    How to recover old behavior?

    Just type in Terminal

    sudo pmset -a standby 0

    now my sleepimage is 8 GB in size and my MBP Retina 2012 does not use swap at all.
     
  15. andrit macrumors newbie

    Joined:
    Sep 14, 2018
    #15
    ... and do not hibernate/standby at all, which means the battery drains faster when computer is left idle for some hours. For example, mine 2015 MBP's overnight drain is ~2% with standby on and ~20-30% without. Wakeup from such standby is only the matter of 1-2 secs (not mins like on PCs or old MBPs, before 2012) so you are robbing yourself from quite a handy power-saving feature.
     

Share This Page

14 December 10, 2017