|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Sleepimage keeps coming back even with SafeSleep disabled
It seems Apple may have changed something in the latest SSD-based notebooks and/or Mountain Lion?
I have "safesleep" disabled currently: $pmset -g | grep hibernatemode hibernatemode 0 The default for laptops is "3" which writes an 8GB or 16GB image of RAM contents to disk, depending on how much RAM you have installed. Once you set it 0 you're supposed to be able to delete the sleepimage file and it never comes back. More info here: http://www.tuaw.com/2011/08/22/why-h...cessary-in-os/ However, even with hibernatemode 0, the "sleepimage" file keeps getting re-created upon reboot or resume from sleep. On my other mac laptops, the file isn't recreated again once its deleted. Anybody else with a rMBP (or 2012 Air) try this?
__________________
2011 Mac Mini Server, 16 GB RAM, 256GB Crucial M4 SSD, 500GB HDD + 3TB NAS Retina Macbook Pro 13" - i5/128GB Mac Mini 1.83GHz Core2Duo, 3GB RAM, 60GB SSD iPad3/iPhone4S |
|
|
|
0
|
|
|
#2 |
|
Are you changing the energy saver options, then selecting to set them to default?
|
|
|
|
0
|
|
|
#3 | |
|
Quote:
|
||
|
|
0
|
|
|
#4 | |
|
Quote:
No, I haven't found a solution yet unfortunately. I've set my hibernate mode back to the default (3) since it doesn't seem to make a difference anyway. One thing I've noticed is that the machine seems to hibernate after it's been asleep for a while, even when the battery is full. Upon opening the lid, the login box appears, but is unresponsive for a few seconds. I assume this is because it's displaying a static snapshot of the screen while it restores from the sleep image. My older mac would gray out the screen and show a progress bar while it restores.
__________________
2011 Mac Mini Server, 16 GB RAM, 256GB Crucial M4 SSD, 500GB HDD + 3TB NAS Retina Macbook Pro 13" - i5/128GB Mac Mini 1.83GHz Core2Duo, 3GB RAM, 60GB SSD iPad3/iPhone4S |
||
|
|
0
|
|
|
#5 |
|
Set sleep mode in shell:
sudo pmset -a hibernatemode 0 Remove the image: sudo rm /private/var/vm/sleepimage Create a blanked file: sudo touch /private/var/vm/sleepimage Make file immutable: sudo chflags uchg /private/var/vm/sleepimage That should do it.
__________________
Mac Pro W3680, GTX 680 2GB, 12GB DDR3, SSD; MBP Mid 2012, 2.6GHz Core i7, 16GB DDR3, SSD Last edited by derbothaus; Nov 9, 2012 at 06:52 PM. Reason: command typos fixed. Thanks! |
|
|
|
2
|
|
|
#6 | ||
|
Quote:
![]() ---------- Quote:
|
|||
|
|
0
|
|
|
#7 | |
|
Quote:
The command left out a '/' before 'private' (Not sure, may need to run with sudo since the file was created using sudo touch. Also unsure how the system will react to the restriction. do at your own risk) |
||
|
|
1
|
|
|
#8 | ||
|
Quote:
,just I needed to add sudo before chflags and '/' before private,thanks a lot though ![]() ---------- Quote:
|
|||
|
|
0
|
|
|
#9 | |
|
Quote:
I was posting from 'up' key history. So the sudo's could have been off. Sudo this, no need to sudo that... Glad you got it working. As pointed out no idea on what this could do to your system over time. I suspect very little. But if you need to ask yourself if it is safe to do then don't do it. It is a workaround that worked for me only and I was really answering back OP as they seemed used to the shell.
__________________
Mac Pro W3680, GTX 680 2GB, 12GB DDR3, SSD; MBP Mid 2012, 2.6GHz Core i7, 16GB DDR3, SSD Last edited by derbothaus; Nov 9, 2012 at 07:32 PM. |
||
|
|
0
|
|
|
#10 | |
|
Quote:
|
||
|
|
0
|
|
|
#11 | |
|
Quote:
__________________
MacBook Pro 15" Late 2011, 2.2GHz, 16GB Patriot RAM, 240GB Intel 335 SSD; Mac Mini 2011 Base model 8GB RAM, stock 500GB Toshiba HD |
||
|
|
0
|
|
|
#12 |
|
/var/vm is a symbolic link to /private/var/vm. Either one should work.
__________________
Mac Pro W3680, GTX 680 2GB, 12GB DDR3, SSD; MBP Mid 2012, 2.6GHz Core i7, 16GB DDR3, SSD |
|
|
|
0
|
|
|
#13 |
|
thanks for this. was wondering where in the blazes the space had gone to.
__________________
Mac Pro 3,1 3.2 GHz Octocore 12GB Radeon HD 5770 4TB 30" ACD MBA 2012 11" 1.7 GHz 8GB 128GB |
|
|
|
0
|
|
|
#14 | |
|
Reversing...
Quote:
And thanks... |
||
|
|
0
|
|
|
#15 |
|
sudo rm /private/var/vm/sleepimage
sudo pmset -a hibernatemode 3 You just need to remove the blank file and reset the hibernation mode and the OS will re-create.
__________________
Mac Pro W3680, GTX 680 2GB, 12GB DDR3, SSD; MBP Mid 2012, 2.6GHz Core i7, 16GB DDR3, SSD |
|
|
|
0
|
|
|
#16 |
|
I noticed this yesterday on my Retina MBP, because all of a sudden 10+ GB of disk space were being used. So far the hacky fix of creating a zero-size sleepimage file and locking it seems to work. I didn't see any log entries related to it.
This is something that Apple seriously needs a better solution for. It's not worth being overly worried about SSD wear, because if you do the math, then you can write some unrealistically huge number of gigbytes daily and you'll be fine for years and years. The sleepimage file changes that in a drastic way. Normally you'd be hard pressed to write 8 or 10GB of data in a day. But now, every time your 8GB machine goes to sleep, either on its own or because you closed the lid, that's 8GB of writes. If that happens 10 times a day, that's 80GB. If you've got 16GB of RAM, then it's 160GB of writes a day. 1.6 TERAbytes every ten days. Writing a huge sleepimage file is a terribly heavy-handed way to prevent one single rare case: running out of power when in sleep mode. Really, the OS should prepare for possible shutdown when sleep starts (flush caches, etc.), and if you've saved your work before sleeping, then no worries. |
|
|
|
0
|
|
|
#17 | |
|
Quote:
If my rMBP battery runs out while it's asleep, then..... oh no! I'll have to wait 12 seconds for it to boot up!
__________________
2011 Mac Mini Server, 16 GB RAM, 256GB Crucial M4 SSD, 500GB HDD + 3TB NAS Retina Macbook Pro 13" - i5/128GB Mac Mini 1.83GHz Core2Duo, 3GB RAM, 60GB SSD iPad3/iPhone4S |
||
|
|
0
|
|
|
#18 |
|
Here's some relevant information:
http://www.ewal.net/2012/09/09/slow-...ok-pro-retina/ There's another parameter called "standbydelay" which is supposed to delay writing the sleepimage for a certain period of time (4200 seconds by default), and then put the laptop in standby mode. I confirmed that I still have the default value of 4200 even though my sleepimage was being written immediately upon closing the lid. However, after sleeping for 70+ minutes I experienced the "slow wake" issue reporting in the link. I haven't seen what happens now after sleeping for 70 minutes, after using the 0-size sleepimage workaround. Maybe the thing just shuts off and then has to cold boot after 70 minutes. It would make more sense to set the standbydelay to 24 hours or something.
__________________
2011 Mac Mini Server, 16 GB RAM, 256GB Crucial M4 SSD, 500GB HDD + 3TB NAS Retina Macbook Pro 13" - i5/128GB Mac Mini 1.83GHz Core2Duo, 3GB RAM, 60GB SSD iPad3/iPhone4S |
|
|
|
0
|
|
|
#19 |
|
OS X 10.8.2 seems to become unstable
...when following the instructions to avoid a sleepimage file. A number of apps simply crash, sometimes even OS X crashes completely.
I enabled the sleepimage file again and all came back to normal. I have a Macbook Pro Retina 16GB 256 SSD running OSX 10.8.2 |
|
|
|
0
|
|
|
#20 | |
|
Monitor the timestamps of the sleepimage file
Quote:
I suggest that you put the machine asleep a few times and monitor the timestamps as you go along. It should give you an idea of what's going on. Code:
Last write access: $ ls -lrth /private/var/vm/sleepimage -rw------T 1 root wheel 16G Nov 19 13:54 sleepimage Last read access: $ ls-luth /private/var/vm/sleepimage -rw------T 1 root wheel 16G Nov 20 19:41 sleepimage
__________________
Mac Mini 2009 - Iphone 4 16GB - rMBP 2.6 - Time Capsule 2TB
|
||
|
|
0
|
|
|
#21 |
|
This is what worked for me:
Disable hibernation: Code:
sudo pmset -a hibernatemode 0 Code:
sudo rm /private/var/vm/sleepimage Code:
sudo ln -s /dev/null /var/vm/sleepimage |
|
|
|
0
|
|
|
#22 | |
|
OK, I'm officially confused now...
I might have been a bit premature in blaming the sleepimage file disablement for the crashes...
I was in contact with VMWare because of their latest release also crashing randomly. Here is the reply AND WORKAROUND (!) "Apple had recently released the MacBook Air and MacBook Pro Update 2.0. It includes graphics performance and reliability enhancements, which actually broke Mac's NVidia GeForce graphics driver with 3D in Fusion 5.0.2. Hence, this crashes are occurring. See: http://blogs.vmware.com/teamfusion/2...-fusion-5.html So, there are two workarounds so far. Either you can use Fusion 5.0.2 and disable 3D acceleration in VM settings > Display. Or downgrade to Fusion 5.0.1. " I disabled the 3D acceleration and my Windows 7 VM runs again properly. Here it comes what makes me all wonder: Although I enabled the sleepimage file, other software like SOAPUI for OS X also crashes or hangs just the same. However, the same SOAPUI built for Windows 7 in my VM runs now without problems (since 3D acceleration is disabled). Could it be that the mess I have is due to an OS X update that broke the NVidia GeForce 3D support in also a few other apps? Ouch! ---------- Quote:
|
||
|
|
0
|
|
|
#23 |
|
I have been looking for an answer for this issue for two days. All the fixes i found seemed to stop short of replacing the sleepimage file with a zero byte version of itself.
Thanks. 8GB back available in my 128 GB SSD I registered just so I can say thanks for the help here. |
|
|
|
0
|
|
|
#24 |
|
For those with 16gb and without flash based hard drives will removing the sleepimage lessen wear and tear on the 750gb mechanical hard drive?
__________________
Late 2011 MBP, iPhone 5 & 4s, iPad Mini |
|
|
|
0
|
|
|
#25 |
|
For me, manually replacing my 4GB sleepimage file with an empty file and locking it prevent most of the Apple menu items (sleep, restart, log off, etc.) from working. I also can't open up various applications (Finder error -600).
|
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 07:32 AM.








,just I needed to add sudo before chflags and '/' before private,thanks a lot though 
Mac Mini 2009 - Iphone 4 16GB - rMBP 2.6 - Time Capsule 2TB
Linear Mode
