Mac笔记本电脑使用的默认睡眠模式是传统睡眠模式(暂停到RAM)和休眠方式(暂停到磁盘)之间的混合体:RAM的内容保存到磁盘,但RAM也保持供电。默认情况下,台式机Mac使用传统的睡眠模式(挂起到RAM)。
见man pmset
:
SAFE SLEEP ARGUMENTS
hibernatemode takes a bitfield argument defining SafeSleep behavior.
Passing 0 disables SafeSleep altogether, forcing the computer into a reg-
ular sleep.
0000 0001 (bit 0) enables hibernation; causes OS X to write memory state
to hibernation image at sleep time. On wake (without bit 1 set) OS X will
resume from the hibernation image. Bit 0 set (without bit 1 set) causes
OS X to write memory state and immediately hibernate at sleep time.
0000 0010 (bit 1), in conjunction with bit 0, causes OS X to maintain
system state in memory and leave system power on until battery level
drops below a near empty threshold (This enables quicker wakeup from mem-
ory while battery power is available). Upon nearly emptying the battery,
OS X shuts off all system power and hibernates; on wake the system will
resume from hibernation image, not from memory.
0000 1000 (bit 3) encourages the dynamic pager to page out inactive pages
prior to hibernation, for a smaller memory footprint.
0001 0000 (bit 4) encourages the dynamic pager to page out more aggres-
sively prior to hibernation, for a smaller memory footprint.
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 memory 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 memory 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.
要使笔记本电脑或台式机Mac始终休眠(挂起到磁盘),请运行:
sudo pmset -a hibernatemode 25
要使笔记本电脑始终以电池电源休眠,请运行:
sudo pmset -b hibernatemode 25
设置hibernatemode
为25
减少睡眠中的能量消耗,但会使醒来时间更长。
在某些情况下,某些新的Mac在经过一定时间的正常睡眠后会自动进入待机模式。请参阅http://support.apple.com/kb/HT4392(Mac计算机:关于待机模式):
可以使用待机模式的Mac:
- MacBook Pro(13英寸视网膜,2012年末)及更高版本
- MacBook Pro(Retina,15英寸,2013年初)及更高版本
- MacBook Pro(Retina,2012年中)
- MacBook Air(2010年中)及更高版本
- Mac mini的SSD和Fusion驱动器版本(2012年末)及更高版本
- iMac的SSD和Fusion驱动器版本(2012年末)及更高版本
2013年或之后生产的Mac计算机经过三小时的“常规”睡眠后进入待机状态。较早的计算机在经过一个多小时的“常规”睡眠后就会激活。
要进入待机状态,计算机必须:
- 正在使用电池供电(如果是Mac笔记本计算机)。
- 没有连接USB设备。
- 没有连接Thunderbolt设备。
- 没有插入SD卡。
- 没有连接外部显示器。
man pmset
:
STANDBY ARGUMENTS
standby causes kernel power management to automatically hibernate a
machine after it has slept for a specified time period. This saves power
while asleep. This setting defaults to ON for supported hardware. The
setting standby will be visible in pmset -g if the feature is supported
on this machine.
standby only works if hibernation is turned on to hibernatemode 3 or 25.
standbydelay specifies the delay, in seconds, before writing the hiberna-
tion image to disk and powering off memory for Standby.
sudo pmset -c standbymode 1
即使没有电池供电,也会启用待机模式。sudo pmset -a standbydelay 1800
会将进入待机模式之前的延迟更改为30分钟。
在某些情况下,某些Mac在正常睡眠四个小时后也会进入休眠状态。请参阅http://support.apple.com/kb/HT1757:
随着OS X Mountain Lion v10.8.2补充更新2.0的发布,引入了一项新功能,可以在计算机连接交流电源四个小时后进入安全睡眠。这是为了遵守欧洲能源标准(ErP Lot6)。仅当没有无线或以太网活动并且没有外部设备(例如USB存储设备)的活动时,才会发生这种情况。
man pmset
:
autopoweroff - Where supported, enabled per default as an implementation
of Lot 6 to the European Energy-related Products Directive. After sleep-
ing for <autopoweroffdelay> minutes, the system will write a hibernation
image and go into a lower power chipset sleep. Wakeups from this state
will take longer than wakeups from regular sleep. The system will not
auto power off if any external devices are connected, if the system is on
battery power, or if the system is bound to a network and wake for net-
work access is enabled.
autopoweroffdelay - delay before entering autopoweroff mode. (Value =
integer, in minutes)
我不知道在hibernatemode
设置为25
,待机模式时使用的休眠模式与在autopoweroff
启用时使用的休眠模式之间是否有任何区别。
待机模式或休眠模式并不能节省那么多能量。根据Apple的环境报告,当前的13英寸MacBook Air处于关闭状态时的功耗为0.25W,在处于230V电压的睡眠模式下时的功耗为0.68W。MacBook Air的电池电量为54瓦时,因此充满电的电池在睡眠模式(如果Mac未进入待机模式)应持续约三天,而在Mac关机时则应持续约九天。休眠或待机模式下的能耗可能接近Mac关机时的能耗。