23

can someone please explain to me what my Mac does while asleep? I am running the latest version of Big Sur (11.4 (20F71)), so I think this is intentional, but I'm not sure why. I have turned off all the battery/power settings that could be the cause (Power nap, etc..)

Please see this screenshot of the times the cpu was working (using istat menus)

enter image description here

Thanks

6
  • 15
    And is iStat menus running while your Mac is sleeping, to provide this graph? ;-) Uninstalling istat menus is an excellent way to reduce worry about what your Mac is doing.
    – benwiggy
    Commented Jul 5, 2021 at 9:19
  • 5
    Good point, but iStat menus doesnt launch it self for no reason, something wakes up the computer and it logs the data, at least I think iStat menus is not supposed to wake up the computer for no reason....
    – dcinderdiu
    Commented Jul 5, 2021 at 11:42
  • 2
    @benwiggy iStatMenus only shows wakes where there has been significant activity. It does not show for brief wakes or changes to sleep states. It is excellent first indication that something is waking the computer and, for a laptop, causing battery drain.
    – Gilby
    Commented Jul 5, 2021 at 23:39
  • 1
    @benwiggy I would love to not worry about it, but numerous times I've woken up to find my MacBook in my backpack running overnight until it's practically red hot. Not good.
    – Alexander
    Commented Jul 6, 2021 at 18:32
  • 1
    It definitely does not dream of electric sheep!!
    – RonJohn
    Commented Jul 6, 2021 at 19:07

2 Answers 2

21

Sleep States:

macOS has multiple layers of sleep. It is not as simple as suggested by the System Preferences Energy Saver choices, nor by this Apple page which makes it seem simple - either sleep or wake.

There is some description of sleep states in the power management man page. Use the Terminal command man pmset. But this is confusing because it mixes superficial description of states with commands which control those states.

I have found web searches to produce different, often contradictory, descriptions of sleep states. My list of sleeping states which is probably not complete and has one question mark:

  • Sleep - just the lid (on a laptop) closed. Screen off. RAM is still powered.
  • Safe Sleep - RAM has been written to disk (hence safe), but still powered.
  • Deep Idle - same as Safe Sleep?
  • Standby - RAM written to disk and RAM and USB powered off.
  • Hibernate - as standby, but everything powered off.

Note that except for hibernate, the Mac will 'Dark Wake' at intervals.

Diagnosis:

To diagnose what is happening we need to inspect the power management log. The detailed log is shown with the Terminal command:

pmset -g log

Whilst we need that for detailed understanding, useful subsets are:

pmset -g log | grep -e "Wake from" -e "DarkWake" -e "due to"
pmset -g log | egrep "\b(Sleep|Wake*|DarkWake|Start)\s{2,}"

We can now see the description for each wake. Amongst other reasons, these can relate timers or network activity. I do not know a source for a comprehensive or detailed explanation of the descriptions.

A byproduct of this is that many lines contain the current battery level, which gives us some idea as to how much the regular wakes are draining the battery.

Controlling sleep and wake (optional):

We can control these wakes - in particular, reduce them so that there is less battery drain. After turning off power nap, etc. in system Preferences, get the current power management parameters with:

pmset -g

There are two different sets depending on whether you have mains power connected or just using the battery. We are most interested in those under battery power and can change them with sudo pmset -b.

For my MacBook I drastically reduced overnight battery drain by disabling network wakes and reducing the time before the MacBook goes into deeper sleep states. My changes include:

  • sudo pmset -b tcpkeepalive 0 to turn off repeated network wakes.
  • sudo pmset -g standbydelayhigh 7200 (2 hours)
  • sudo pmset -g standbydelaylow 7200 (2 hours)
  • sudo pmset -g autopoweroffdelay 14400 (4 hours)

Don't make too many changes at once and (as used to be recommended) don't change hibernatemode to 25.

5
  • 4
    If "Find My Mac" is enabled, then it must wake up sometimes. My Mac certainly reports its position while left asleep for days. Commented Jul 6, 2021 at 8:40
  • @DmitriUrbanowicz "Find My Mac": I wonder if power management log reports it? Have a look. I've got mine so locked down it doesn't even do any Dark Wakes during the night, so I am sure "Find My Mac" would not get updates.
    – Gilby
    Commented Jul 6, 2021 at 9:30
  • Yeah, it probably simply relies on tcpkeepalive. Commented Jul 6, 2021 at 14:51
  • Why did you put a star on Wake*? Commented Jul 7, 2021 at 15:02
  • @ThomasAyoub. Good question! I have been using that so long that I don't remember why the *. And a test just now shows no extra results from using the *.
    – Gilby
    Commented Jul 7, 2021 at 22:13
6

Some of those spikes look to be every hour, which would suggest Time Machine is launching.

8
  • 1
    Should this happen with Power Nap disabled?
    – nohillside
    Commented Jul 5, 2021 at 9:16
  • 1
    I don't know for certain, but I wouldn't be surprised if Macs were still doing things while sleeping, even with Power Nap off.
    – benwiggy
    Commented Jul 5, 2021 at 9:24
  • 1
    As stated earlier, I have the Power Nap option set to off, so the computer really can't be checking for any time machine backups
    – dcinderdiu
    Commented Jul 5, 2021 at 11:41
  • 4
    Have you looked through the logs to see if any messages correspond with those times?
    – benwiggy
    Commented Jul 5, 2021 at 12:53
  • 3
    Time Machine makes a local snapshot every hour or so, even if the Mac is sleeping, and even if no TM disk is plugged in. BigSur Help for 'local snapshot' says "Local snapshots are only stored on disks using Apple File System (APFS) when Back Up Automatically is selected in Time Machine preferences."
    – Bob Werner
    Commented Jul 6, 2021 at 16:49

You must log in to answer this question.

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