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'.

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM