Sleepimage keeps coming back even with SafeSleep disabled

Discussion in 'MacBook Pro' started by CausticPuppy, Oct 31, 2012.

  1. lilabila macrumors member

    Joined:
    Mar 27, 2011
    #26
    I can confirm that the issue still persists on 10.8.3
    At least my sleepimage file is only 2GB out of 16GB RAM
     
  2. blackberrycubed macrumors 6502

    Joined:
    Feb 26, 2013
  3. falcn macrumors member

    falcn

    Joined:
    Aug 6, 2011
    #28
    Yep, there is a bug in ML that make sleep image come back even if hibernatemode is set to 0.

    I have 16Gb of RAM, so that is kinda irritating.

    Workaround:

    sudo rm /var/vm/sleepimage
    sudo mkdir /var/vm/sleepimage

    Works like a charm:
    drwxr-xr-x 2 root wheel 68 May 14 09:49 sleepimage/
     
  4. chaseychasem, Jun 10, 2013
    Last edited: Jun 10, 2013

    chaseychasem macrumors regular

    Joined:
    Aug 4, 2012
    #29
    Tried this for the first time today after applying the 10.8.4 patch. Doesn't work, unfortunately. Sleepimage always returns. Any tips? Is there a way to undo this setting if nothing does the trick? Would that even be necessary?

    EDIT: Never mind. I think I got it, but the fact that Chameleon still showed Disable Sleep Image as off confused me. I assume this is due to the nature of the workaround?
     
  5. technowar macrumors 6502

    Joined:
    Apr 1, 2011
    Location:
    Cebu, Philippines
    #30
    Brilliant. Thank you for this!
     
  6. sir. mac macrumors regular

    Joined:
    Nov 21, 2006
    #31
    Thanks a bunch!
    This worked, but what does the last command do, and is it reversible?

    this: sudo ln -s /dev/null /var/vm/sleepimage
     
  7. bert32 macrumors newbie

    Joined:
    Aug 5, 2009
    #32
    I think it creates an alias
     
  8. priitv8 macrumors 68020

    Joined:
    Jan 13, 2011
    Location:
    Estonia
    #33
    It redirects (creates a symbolic link in Unix terms) sleepimage file to dev null (the black hole of Unix). So everytime system writes to sleepimage, the bytes are drained to outer space.
    It is reversible, just
    Code:
    sudo rm /var/vm/sleepimage
     
  9. sir. mac macrumors regular

    Joined:
    Nov 21, 2006
    #34
    On a related note, now "swap-files" of 1GB keep cropping up. Anyone know how to fix this?

     
  10. priitv8 macrumors 68020

    Joined:
    Jan 13, 2011
    Location:
    Estonia
    #35
    I'm not sure why would you want to mess with virtual memory management of OS X, but if you insist, then you can disable the Apple dynamic pager and get rid of the swapfiles, as instructed in this article:
    http://osxdaily.com/2010/10/08/mac-virtual-memory-swap/

    Once you're done, you are left with only physical memory that you've got installed (4GB, 8GB, 16GB or whatever you have in your Mac), no virtual memory.

    NB! I also recommend you read the comments to the article above before making the final cut.
     

Share This Page