查看当前配置 pmset
~ » pmset -g hans@zzz
System-wide power settings:
Currently in use:
standby 1
Sleep On Power Button 1
womp 1
halfdim 1
hibernatefile /var/vm/sleepimage
powernap 0
gpuswitch 2
autorestart 0
networkoversleep 0
disksleep 10
sleep 0 (sleep prevented by useractivityd, AddressBookSourceSync, configd)
autopoweroffdelay 28800
hibernatemode 0
autopoweroff 1
ttyskeepawake 1
displaysleep 60
tcpkeepalive 1
standbydelay 10800
当前默认配置 hibernatemode 0
我们需要配置成 25 存储到磁盘上,并且清空内存,就是开机慢。
要速度快 请设置成 3
下面是官文的说明
hibernatemode = 0 (binary 0000) by default on supported desktops. The system will not back memory up to
persistent storage. The system must wake from the contents of memory; the system will lose context on
power loss. This is, historically, plain old sleep.hibernatemode = 3 (binary 0011) by default on supported portables. The system will store a copy of mem-ory memory
ory to persistent storage (the disk), and will power memory during sleep. The system will wake from
memory, unless a power loss forces it to restore from disk image.hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The system will store a copy of mem-ory memory
ory to persistent storage (the disk), and will remove power to memory. The system will restore from
disk image. If you want "hibernation" - slower sleeps, slower wakes, and better battery life, you
should use this setting.
设置磁盘存储的深度睡眠 pmset -a
sudo pmset -a hibernatemode 25
参考文
- pmset
https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/pmset.1.html