zoukankan      html  css  js  c++  java
  • Hibernate与Sleep的区别

    转自:http://blog.sina.com.cn/s/blog_4b6e98810100n37k.html

    休眠(Hibernate),将系统切换到该模式后,系统会自动将内存中的数据全部转存到硬盘上一个休眠文件中,然后切断对所有设备的供电。这样当恢复的时候,系统会从硬盘上将休眠文件的内容直接读入内存,并恢复到休眠之前的状态。这种模式完全不耗电,因此不怕休眠后供电异常,但代价是需要一块和物理内存一样大小的硬盘空间(好在现在的硬盘已经跨越TB级别了,大容量硬盘越来越便宜)。而这种模式的恢复速度较慢,取决于内存大小和硬盘速度,一般都要1分钟左右,甚至更久。
     
      睡眠(Sleep),是Windows Vista中的新模式,这种模式结合了待机和休眠的所有优点。将系统切换到睡眠状态后,系统会将内存中的数据全部转存到硬盘上的休眠文件中(这一点类似休眠),然后关闭除了内存外所有设备的供电,让内存中的数据依然维持着(这一点类似待机)。这样,当我们想要恢复的时候,如果在睡眠过程中供电没有发生过异常,就可以直接从内存中的数据恢复(类似待机),速度很快;但如果睡眠过程中供电异常,内存中的数据已经丢失了,还可以从硬盘上恢复(类似休眠),只是速度会慢一点。不过无论如何,这种模式都不会导致数据丢失。
      正因为睡眠功能有这么多优点,因此Windows Vista开始菜单上的电源按钮默认就会将系统切换到睡眠模式。所以我们大可充分利用这一新功能,毕竟从睡眠状态下恢复,速度要比从头启动快很多。而且睡眠模式也不是一直进行下去的,如果系统进入睡眠模式一段时间后(具体时间可以设定)没有被唤醒,那么还会自动被转入休眠状态,并关闭对内存的供电,进一步节约能耗。

      A 'Sleeping' computer awakens quicker than one which is hibernating.  The downside of Sleep is that you lose unsaved data in the case of a complete power loss, this is because the information is stored in RAM.  Hibernate on the other hand, saves the contents of memory into a physical file called hiberfil.sys, thus you would not lose unsaved data.One more point, Windows 7 has a setting called 'Hybrid sleep', which combines sleep and hibernate as described above.
      If I work with the Aero graphics at maximum brightness, my AS4741G's battery will not last much more than 90 minutes.  Therefore, anything that I can do to conserve battery power, will increase the time I can use my laptop away from the mains electricity.  As with all task's, micro-management is counter-productive, in the case of the laptop you have to balance the hesitations from coming out of 'Sleep', with the battery wastage when you get up from the laptop in order to perform some other task in the room.

      Windows 7's Sleep saves data to memory (RAM) and then switches to minimal power mode.  The disadvantage is a 5 second delay while Windows 7 manages the switch back to normal power mode. In the event of a power failure you would lose any unsaved data which is stored in RAM.  You may also have to re-enter your password to resume after sleep, however that is another configurable setting.  See 'Require a password on wakeup' from the task list menu.
      Windows 7's Hibernation stores unsaved data, including information about open programs, to a special file called hiberfil.sys. This means that your data is safe even if you switch of the mains and take out the battery.  When the machine restarts, it loads the data stored in hiberfil.sys and thus returns the machine to the precise state when you set it to hibernate. Incidentally, hiberfil.sys is a hidden file, which is always found in the root of the c: drive. To see the file, you may need to adjust your Explorer's settings.  Press the Alt key, then click on the View tab and now scroll down to Hidden files and folders. Select the radio button next to Show hidden files and folders.
       If you figure out the role of Microsoft's hiberfil.sys, then you understand why Hibernation sometimes is not an option.  For example, there may be insufficient disk space on the C: drive to create this huge file, or some older Bios software cannot manage suspend to disk or suspend to RAM.  You if you wish to use the Hibernate option, be careful that a Disk Cleanup operation does not delete hiberfil.sys, and thus at least temporarily, remove the option to hibernate. (Solution issue the command line instruction: powercfg -h on)
       In the case of Window 7's Hybrid Sleep, it gives you the speed of Sleep, combined with the resilience of Hibernation.  If all goes well then your machine comes out of Hybrid Sleep in less than 5 seconds, if all goes badly, then it takes relatively ages for the desktop to return, but at least you can recover your unsaved data from hiberfil.sys.
       If you were of a mind, you could choose a different combination of Power Settings everyday of the year, and never repeat the same setting twice.  For this reason, Windows 7 groups settings into Plans for example,  Power Saver, High Performance, or Balanced.  The advantaged of these pre-configured Plans is that you get consistent and compatible settings for: 'Turn off the Display', 'Put the Computer to Sleep' and 'Adjust Display Brightness'.

  • 相关阅读:
    Hash大法
    最小表示法
    KMP算法题集
    分块总结
    2018 雅礼国庆集训
    二分图总结
    贪心总结
    Tire树总结(模板+例题)
    工具类文章合集
    网文胡乱汇总
  • 原文地址:https://www.cnblogs.com/predator-wang/p/5498066.html
Copyright © 2011-2022 走看看