Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a MacBook Air and I have noticed that even though I have configured it to put itself into sleep mode after being inactive for 5 minutes it sometimes stays awake.

I've usually got a bunch of programs open (Tweetie, iTunes, Safari, iChat etc) but it there some way I can find out which program/process that is preventing the MacBook from sleeping? (Yes, I know that I could probably reboot the MacBook and try one program at a time but that is pretty tedious)

share|improve this question

Try this. It might work for you.

  1. Go to Utilities in the Applications folder and open the "Terminal" app.

  2. Type pmset -g and hit Enter

  3. If "sleep" has 0 next to it and the words "imposed by" or "prevented by ; The number next to the imposed by is the process ID causing the problem. Copy that number.

  4. Type ps -e | grep <process ID here> and hit Enter. This will list all running processes that have that ID (will also include the grep process)

In my case it was process id 19 which turned out in this instance to be a print server process. I went to "Print & Scan" in System Preferences and reset deleting all installed printers from there. . . Problem solved. I added the one printer that I needed and sleep still works. I don't yet understand quite how printing can get this way with the sleep mode.

share|improve this answer

"Inactive" is hard to determine from looking at your system. You should use a process monitor, like "top" or "Activity Monitor" and see what is going on. You can quit apps to isolate the problem.

For browsers, flash or other plugins are often the cause. Your average web page is much more CPU intensive than it was a couple years ago. Also, background downloads probably also keep it from sleeping.

share|improve this answer
can a CPU-hogging browser prevent the MacBook from sleeping? – jimr Dec 19 '10 at 22:30
I have seen flash-ads on the current page of the current browser cause a system to refuse to sleep-and-stay-asleep. – benc Dec 22 '10 at 5:52

Try to use the command:

pmset -g

It will sometimes display the processes preventing your mac from sleeping.


share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .