Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have my MacBook set to go to sleep after 2 minutes while on battery (via the Energy Saver preference pane.) However, when I leave it idle, it only turns off the screen—it does not actually sleep. This means that if I leave it and forget to close the lid, it always ends up with a dead battery.

The system sleeps correctly if it is triggered manually ( – Sleep) or by closing the lid. I have tested it with no USB devices connected and on a fresh user account, on the chance a background program was preventing sleep. There is no relevant information printed to the Console at the time when the system should sleep.

I've performed a PRAM and SMC reset to no avail, as well as the usual superstitious Verify Disk Permissions.

Is there anything else I should try before I reinstall OS X?

This is a MacBookPro5,5 running OS 10.6.6.

It's worth noting that I suffered from this issue some time ago due to a bug in a helper daemon for the product Things, but that this issue was slightly different and involved display sleep. Also, I have verified that the helper daemon was not running during my tests.

Additional information:

I started working through the Apple document titled "Why your Mac might not sleep or stay in sleep mode." I discovered that this issue does not appear when I Safe Boot my computer. I diff'd the process lists and discovered that the following programs are only running when in normal boot, and are thus possible culprits:

  • Quick Look Helper
  • cvmsComp_x86_64
  • kextcache
  • launchd
  • mdworker
  • mdworker
  • nmblookup
  • vmnet-bridge
  • vmnet-dhcpd
  • vmnet-dhcpd
  • vmnet-natd
  • vmnet-netifup
  • vmnet-netifup
share|improve this question
    
Make sure you're setting Computer Sleep and not Display sleep. Photo here: imgur.com/yVGb4.png –  Nathan Greenstein Jan 22 '11 at 17:48
1  
Out of curiosity, can you try setting Display Sleep to something after the Computer Sleep? Maybe we'll find a bug. The other thing that comes to mind: Maybe your screensaver is activating and keeping something from sleeping (this would also be a bug). Try changing settings until it goes smoothly, Screen Saver, Display Sleep, Computer Sleep, with at least a minute between each. –  Nathan Greenstein Jan 22 '11 at 18:10
1  
The preference pane prevents you from setting Display Sleep to after Computer Sleep. I did try them as both the same thing and different (thinking the former might have a bug.) I also just tried Screen Saver, Display Sleep, and Computer Sleep with a minute between them, but no dice. –  Phil Calvin Jan 22 '11 at 18:29
1  
@Martin Wickman: I may have solved this. I had less than 5% free space on my System volume, which was being logged to the system log (but not in a way that made it clear there was a relationship.) Freeing up 50GB solved the issue. Are you also low on free space? –  Phil Calvin Feb 2 '11 at 15:52
1  
I just found out about pmset -g assertions which shows some info about what process (or something) is preventing sleep. Check it out. –  Martin Wickman Oct 15 '11 at 20:18
show 14 more comments

4 Answers 4

I’ve had this same issue with my MacBook Pro 3,1. It’s extremely frustrating. I went so far as to completely reinstall OS X, which didn’t solve the issue. This leads me to believe that it’s likely a hardware issue in my case.

I’ve given up troubleshooting the issue and just use PleaseSleep.

PleaseSleep is a utility software designed for Mac OS X that helps put your computer to sleep when you know some other app is preventing your Mac from going to sleep.

PleaseSleep sits in the background and waits for the sleep timer you set in Energy Saver preferences pane. Depending on the preferences you set, PleaseSleep will try to put your computer to sleep when the scheduled sleep timer kicks in. PleaseSleep is very easy to configure, you can enable, disable, and access its preferences via the system menu bar icon. You can choose to have PleaseSleep activate the sleep function all the time, or you can tell PleaseSleep to activate the sleep function only when certain apps are running.

share|improve this answer
    
This is scary! If I am unable to find a "true" solution, I will most certainly try this product and accept your answer. However, I am stubborn and not willing to give up just yet. =) –  Phil Calvin Feb 1 '11 at 22:59
    
Doesn't work on 10.8 –  sorin Mar 25 '12 at 14:17
add comment
up vote 3 down vote accepted

I finally have my system reliably idle-sleeping again. I changed three things to reach this point, all of which I believe were contributors:

  • I was low on disk space (less than 5% free) on my primary volume. The kernel was complaining about this to system.log (viewable in Console.app) about the time it should have been sleeping.

  • I disabled Dropbox, which accesses the disk frequently and obnoxiously, and is reported to prevent sleep in Snow Leopard.

  • I upgraded from an embarrassingly old Chromium nightly, and I'm now on 11.0.658.0 (73560). There are several bugs open about this Chrome/Chromium preventing idle sleep. However, I discovered this only after getting the system to idle sleep after a reboot with no programs running.

Technical observations follow:

It's worth noting that the Energy Saver preference pane lies a little bit. I have it set to sleep and turn off the screen after 1 minute, but the system doesn't actually go to sleep for 3 minutes and 30 seconds, give or take a few seconds to write the Safe Sleep image. The screen actually takes 2 minutes to go to sleep. I suspect this is a case of Apple knowing better than us—1 minute is probably just too fast. Regardless, this makes debugging issues like this hard because you have to wait longer than indicated to see if the system is really going to sleep.

That these two applications were contributors despite not doing anything particularly intensive suggests that Snow Leopard changed something about how the system decides whether idle sleep can occur. There is a documented API for disabling idle sleep, but it also appears that disk activity (specifically writes) more than once a minute also resets the sleep timer and thus delays sleep. Any application that writes frequently is thus a possible cause. sudo fs_usage -e grep -f filesys | grep -e write in a Terminal window can help reveal culprits.

share|improve this answer
1  
The command usage here should probably be: sudo fs_usage -e grep -f filesys | grep write Without -e, it'll just vomit up the grep writes. Not helpful. –  Dominic Hopton Nov 25 '11 at 18:09
    
Interesting! No vomiting occurred when I was testing this on Snow Leopard, but it does on Lion. Fixed. –  Phil Calvin Dec 10 '11 at 5:43
    
There's a fairly long thread over on the Apple discussion forums that suggests Lion introduces some new possible sleep issues relating to printers and network shares. More things to try if you are, like I was, at wits' end. –  Phil Calvin Dec 10 '11 at 5:55
add comment

To help debug sleeping issues, try this command in the terminal:

$ pmset -g assertions

Assertion status system-wide:
   ChargeInhibit                           0
   PreventUserIdleDisplaySleep             0
   PreventUserIdleSystemSleep              1
   NoRealPowerSources_debug                0
   CPUBoundAssertion                       0
   EnableIdleSleep                         1
   PreventSystemSleep                      0
   DisableInflow                           0
   DisableLowPowerBatteryWarnings          0
   ExternalMedia                           0

Listed by owning process:
  pid 2520: [0x0000012c000009d8] PreventUserIdleSystemSleep named: "com.apple.audio.'AppleHDAEngineOutput:1B,0,1,2:0'.noidlesleep" 

In this case, it's the process 2520 messing up. Check it out in activity monitor and kill it (/usr/sbin/coreaudiod started by iTunes).

After that, run the command again:

Assertion status system-wide:
   ChargeInhibit                           0
   PreventUserIdleDisplaySleep             0
   PreventUserIdleSystemSleep              0
   NoRealPowerSources_debug                0
   CPUBoundAssertion                       0
   EnableIdleSleep                         1
   PreventSystemSleep                      0
   DisableInflow                           0
   DisableLowPowerBatteryWarnings          0
   ExternalMedia                           0

No flags for PreventUserIdleSystemSleep.

share|improve this answer
    
This is a fantastic use of pmset I didn't know about. Thanks for bringing this to my attention. –  Phil Calvin Nov 15 '11 at 3:49
add comment

Might be Spotlight indexing. You could test this by going to System Preferences > Spotlight > Search Results and unchecking everything. Then see if your MacBook goes to sleep.

share|improve this answer
    
I disabled indexing using mdutil -a -i off, but the problem persisted. Please let me know if that is not functionally equivalent to your suggestion. –  Phil Calvin Feb 1 '11 at 22:54
    
I don't know if it's functionally the same. But it's quick to test so why not try it as described? –  conorgriffin Feb 2 '11 at 8:24
    
Do you have Skype? –  Martín Marconcini Feb 2 '11 at 17:41
    
@martin-marconcini - You asking @Phil-Calvin or me? –  conorgriffin Feb 2 '11 at 17:54
add comment

protected by Community Jan 31 '12 at 16:04

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.