Naughty Mac – crashing every night? tut tut!
I enjoy learning new technologies – after all I so worki in sw engineering, but this little tidbit surprised me.
I was wondering why many (but not all) mornings my new (work provided) macbook pro 15 (2016 TB) would appear to boot from cold, restart apps etc. One obvious thought was a system crash/kernel panic, but I saw no evidence in the log files for that.
I then read about issues with hibernation and looked at the ‘pmset’ command, initially to ensure standby went ram-only rather than to disk. (default is 3 which is both).
So what is ‘autopoweroffdelay’. Yep that’s the one. Many of you probably know this, but it turns out that on AC (not battery) macOS will power off the machine completely after a configurable time period (default=8 hours), even when in standby . My mac was indeed on AC effectively – well actually it was DC since powered by my USB-C monitor
Clearly I’ve been slack in being away from the mac for more than 8 hours some days of the week. Was this a hint?
Anyway fixed now with
pmset autopoweroffdelay 64800
which sets that delay to 18 hours
you can also check with
pmset -g global
Or disable the feature with
pmset autopoweroff 0
You can also change whether hibernation saves to ram only
pmset hibernatemode 0
(0 is ram only, 3 is ram+disk, 25 is disk only)
This last one I’m still considering, currently 3, but may try 25 as a post-3 hour wakeup from SSD should be a minor hit, and means 0 power use – perhaps relevant for Battery rather than AC
Each command also allows ‘-b’ for battery only or ‘-c’ for charger (AC) only