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.

Until recently, when I pressed Option-Cmd-Eject, my MacBook Pro used to go to sleep almost immediately (e.g. within three or four seconds). It's a MBP 8,2 with an SSD and 8GB RAM.

Since a week or so, it takes much longer; around fifteen seconds or even more. Here's the console output from pressing the keyboard shortcut until the kernel's sleep message:

7/31/11 11:50:59 PM mDNSResponder[17]   Client application bug: DNSServiceResolve(charon._smb._tcp.local.) active for over two minutes. This places considerable burden on the network.
7/31/11 11:50:59 PM mDNSResponder[17]   Client application bug: DNSServiceResolve(Meredith(SSH)._ssh._tcp.local.) active for over two minutes. This places considerable burden on the network.
7/31/11 11:51:03 PM kernel  PM notification timeout (pid 3715, Google Chrome He)
7/31/11 11:51:03 PM kernel  hibernate image path: /var/vm/sleepimage
7/31/11 11:51:03 PM kernel  sizeof(IOHibernateImageHeader) == 512
7/31/11 11:51:03 PM kernel  Opened file /var/vm/sleepimage, size 8589934592, partition base 0xc805000, maxio 400000 ssd 1
7/31/11 11:51:03 PM kernel  hibernate image major 14, minor 2, blocksize 512, pollers 5
7/31/11 11:51:03 PM kernel  hibernate_alloc_pages flags 00000000, gobbling 0 pages
7/31/11 11:51:03 PM kernel  hibernate_setup(0) took 0 ms
7/31/11 11:51:06 PM kernel  IOThunderboltSwitch::i2cWriteDWord - status = 0xe00002ed
7/31/11 11:51:06 PM kernel  System SafeSleep
7/31/11 11:51:15 PM kernel  IOThunderboltSwitch::i2cWriteDWord - status = 0x00000000
7/31/11 11:51:15 PM kernel  hibernate_page_list_setall start 0xffffff809225b000, 0xffffff809229b000
7/31/11 11:51:15 PM kernel  hibernate_page_list_setall time: 447 ms
7/31/11 11:51:15 PM kernel  pages 1564968, wire 250981, act 375476, inact 548, spec 267, zf 6140, throt 0, could discard act 115301 inact 538951 purgeable 39710 spec 237594
7/31/11 11:51:15 PM kernel  hibernate_page_list_setall found pageCount 633412
7/31/11 11:51:15 PM kernel  IOHibernatePollerOpen, ml_get_interrupts_enabled 0
7/31/11 11:51:15 PM kernel  IOHibernatePollerOpen(0)
7/31/11 11:51:15 PM kernel  writing 631584 pages
7/31/11 11:51:15 PM kernel  encryptStart 69aa50
7/31/11 11:51:15 PM kernel  encryptEnd 89ade70
7/31/11 11:51:15 PM kernel  image1Size 310265344, encryptStart1 69aa50, End1 89ade70
7/31/11 11:51:15 PM kernel  encryptStart 127e4600
7/31/11 11:51:15 PM kernel  encryptEnd 40c9f7c0
7/31/11 11:51:15 PM kernel  PMStats: Hibernate write took 8066 ms
7/31/11 11:51:15 PM kernel  all time: 8066 ms, comp time: 2645 ms, deco time: 0 ms, 
7/31/11 11:51:15 PM kernel  image 1086978048, uncompressed 2587336704 (631674), compressed 1074427632 (41%), sum1 4849c5df, sum2 d1708974
7/31/11 11:51:15 PM kernel  wired_pages_encrypted 146094, wired_pages_clear 103149, dirty_pages_encrypted 382431
7/31/11 11:51:15 PM kernel  hibernate_write_image done(0)
7/31/11 11:51:15 PM kernel  sleep

Note that I am aware of this question, but I haven't changed anything in the system and it used to go to sleep faster than now. Considering that PMStats reports a hibernation write time of over eight seconds, this leads me into thinking it is the RAM content.

The only system changes I remember are installing the two updates for 10.6 that came out just before Lion's final release. Did that change anything?

How would I go about troubleshooting this?


Even after

sudo pmset -a hibernatemode 0
sudo pmset -a hibernatemode 1

it takes roughly the same time to sleep.


FYI, here's the information from a "clean" (non-safe) sleep:

8/1/11 2:26:49 PM   kernel  AirPort: Link Down on en1. Reason 8 (Disassociated because station leaving).
8/1/11 2:26:50 PM   kernel  IOThunderboltSwitch::i2cWriteDWord - status = 0xe00002ed
8/1/11 2:26:50 PM   kernel  IOThunderboltSwitch::i2cWriteDWord - status = 0x00000000
8/1/11 2:26:50 PM   kernel  IOThunderboltSwitch::i2cWriteDWord - status = 0xe00002ed
8/1/11 2:26:50 PM   kernel  IOThunderboltSwitch::i2cWriteDWord - status = 0xe00002ed
8/1/11 2:26:50 PM   configd[14] network configuration changed.
8/1/11 2:26:50 PM   kernel  System Sleep
8/1/11 2:26:50 PM   kernel  IOThunderboltSwitch::i2cWriteDWord - status = 0x00000000
8/1/11 2:26:50 PM   configd[14] network configuration changed.
8/1/11 2:26:50 PM   kernel  IOThunderboltSwitch::i2cWriteDWord - status = 0xe00002ed
8/1/11 2:26:50 PM   configd[14] setting hostname to "charon.local"
8/1/11 2:26:50 PM   kernel  IOThunderboltSwitch::i2cWriteDWord - status = 0xe00002ed
8/1/11 2:26:50 PM   kernel  IOThunderboltSwitch::i2cWriteDWord - status = 0xe00002ed
8/1/11 2:26:58 PM   kernel  Wake reason = EHC2
8/1/11 2:26:58 PM   kernel  System Wake
share|improve this question
    
Have you tried a reboot after pmset to ensure the writing a sleepimage change takes effect? For most, waiting for 8g of ram contents to sync to disk causes the delay. Do post the system.log messages for a non safe sleep timings as well - might help –  bmike Aug 1 '11 at 12:16
    
I updated it. Having 45GB available and never taking more space than that, it doesn't seem like a performance thing (haven't had performance issues with the SSD yet). I think 5GB of memory were in use though. –  slhck Aug 1 '11 at 12:30
    
This is relevant: apple.stackexchange.com/questions/56432/… –  Aram Kocharyan Jul 15 '12 at 3:43
add comment

3 Answers

up vote 3 down vote accepted

Considering that PMStats reports a hibernation write time of over eight seconds, this leads me into thinking it is the RAM content.

Exactly. Your RAM contents are written to the disk, in the default sleep mode, called "Safe sleep", which takes longer the more RAM you have. You can modify this with the PMSet command in terminal.

sudo pmset -a hibernatemode 0

and then reboot.

If you disable this option, you can also remove the sleepimage file from /var/vm, and reclaim 8GB of hard disk space. Do note that you will lose data then if you sleep for too long and the battery dies.

share|improve this answer
    
sudo pmset -a hibernatemode 0 (as suggested in the other question) did not change anything though. Still the same sleep times (about 15 seconds). –  slhck Aug 1 '11 at 11:51
1  
Odd, did you reboot? And did you delete the sleep image? If you run pmset -g | grep hibernate mode, does it show 0? There's also that "smart sleep" app. –  Paul Eccles Aug 1 '11 at 12:02
    
It should be grep hibernatemode, but it is set to 1 anyway. No sleep image to be found. I'll try rebooting now. –  slhck Aug 1 '11 at 12:07
    
Thanks. Also the sleepimage is in /var/vm –  Paul Eccles Aug 1 '11 at 12:09
    
Removing the sleep image won't likely help other than th be sure it didn't get recreated after the reboot ( an indirect way of making sure pmset worked) –  bmike Aug 1 '11 at 12:12
show 2 more comments

I used to have an episode of slow boot, shutdown, sleep and hibernate. When I turn on verbose mode during boot-up, it was stuck at "Waiting for DSMOS" for a long time. See this link. To solve it, see this link.

Thereafter, all my slow-downs were gone.

share|improve this answer
    
Shutting down and booting is fine actually, it's only the safe sleep that's being slow. Thanks though, I'll read through it! –  slhck Aug 6 '11 at 7:13
add comment

Do you by any chance have a firewire device plugged in? If I try to sleep my Macpro (tower) with an older iSight camera plugged in via Firewire, it takes 10-20 seconds to sleep, vs the normal 2-3.

share|improve this answer
    
For me that wasn't the case, but good to know! –  slhck Jun 4 '12 at 13:44
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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