A MacBook running MacOS ventura was freezing often when entering sleep or waking up. I noticed the freeze from keyboard lights which stayed on. When the laptop entered properly sleep mode, keyboard lights went off. The only way to wake up frozen laptop was to force reboot by pressing the power button for 10 seconds.

Sometimes the laptop woke up from sleep mode by itself, drained tbe battery completely and failed to return to sleep. Once it happened in the middle of the night and in the morning the laptop was burning hot and frozen. I managed to fix the issue by adjusting power management settings. I have had no sleep issues in the past 2 weeks.
You can check your current power management settings by opening a console and typing the following command
The settings that were enabled by default and apparently froze the laptop were:
- powernap
- networkoversleep
- tcpkeepalive
To fix the issue, I disabled the settings issuing the following commands:
Code: Select all
sudo pmset -a powernap 0
sudo pmset -a networkoversleep 0
sudo pmset -a tcpkeepalive 0
Sudo runs the command using root privileges, -a means the setting is applied to all power plans, 0 means disabled and 1 means enabled.
Without powernap apps do not update during sleep (for example checking new emails). Not allowing networkoversleep will stop shared network services during sleep. Disabling tcpkeepalive will disable some services like 'Find My Mac' during sleep.
Thanks to this change, the battery drain decreased significantly, laptop stopped waking up magically and the system will no longer freeze during sleep.
You can read the pmset manual page by typing command
Sleep well,
Santeri