转自: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'.

Hibernate与Sleep的区别的更多相关文章

  1. 简述 Hibernate 和 JDBC 的区别、优缺点

    1.hibernate是一个开源的.采用面向对象的思想实现ORM映射框架,它对jdbc进行了一层封装,对于数据库的连接.关闭.数据的持久化(增删改查).事务的管理都进行了封装,使得程序开发的时候可以用 ...

  2. Jdbc、Mybatis、Hibernate各自优缺点及区别

    文章出处:Jdbc,Mybatis,Hibernate各自优缺点及区别 先比较下jdbc编程和hibernate编程各自的优缺点. 1.JDBC 我们平时使用jdbc进行编程,大致需要下面几个步骤:  ...

  3. 对比JPA 和Hibernate 和 Mybatis的区别

    1.JPA.Hibernate.Mybatis简单了解 1.JPA:本身是一种ORM规范,不是ORM框架.由各大ORM框架提供实现. 2.Hibernate:目前最流行的ORM框架,设计灵巧,文档丰富 ...

  4. Hibernate 和Mybatis的区别

    Hibernate 和Mybatis的区别   1.hibernate 入门门槛高,是一个标准的ORM框架(对象关系映射),不需要程序写sql,sql语句自动生成,对sql语句进行优化.修改比较困难. ...

  5. hibernate和ibatis的区别

    通过别人的资料,进行自己关注的一些扼要点的整理 共同点: 1. 不同点:1. 自动化程度上,hibernate是全自动化的orm框架,提供了对象到数据库的完全映射和sql的内部自动生成,其对象映射是指 ...

  6. jdbc,mybatis,hibernate各自优缺点及区别

    先比较下jdbc编程和hibernate编程各自的优缺点.    JDBC:    我们平时使用jdbc进行编程,大致需要下面几个步骤:    1,使用jdbc编程需要连接数据库,注册驱动和数据库信息 ...

  7. hibernate与mybatis的区别和应用场景

    mybatis 与 hibernate 的区别和应用场景(转) 1    Hibernate : 标准的ORM(对象关系映射) 框架: 不要用写sql, sql 自动语句生成: 使用Hibernate ...

  8. hibernate与ibatis的区别

    Hibernate 是当前最流行的O/R mapping框架,当前版本是3.05.它出身于sf.net,现在已经成为Jboss的一部分了 iBATIS 是另外一种优秀的O/R mapping框架,当前 ...

  9. Mybites和hibernate的优缺点和区别

    Hibernate 是当前最流行的O/R mapping框架,它出身于sf.net,现在已经成为Jboss的一部分. Mybatis 是另外一种优秀的O/R mapping框架.目前属于apache的 ...

  10. Hibernate get load的区别

    这两个函数都是用来从数据库中加载对象,其区别说起来主要有以下两点: 1.如果数据库中不存在该对象,那么load是抛出一个ObjectNotFound的异常,而get是返回一个空指针 2.加载机制不同 ...

随机推荐

  1. 移动互联网app

    移动互联网app 2 App测试点 2.1安全测试 2.1.1软件权限 1隐私泄露风险:包括访问手机信息.访问联系人信息等 2对App的输入有效性校验.认证.授权.敏感数据存储.数据加密等方面进行检测 ...

  2. Users is not mapped(Hibernate实体类采用注解)

    今天做简单的登陆验证web应用时,用HQL语句查询数据表时 总是出现Users is not mapped [from Users u where u.username=? and u.passwor ...

  3. hibernate主键generator属性介绍

    increment(递增) 用于为long, short或者int类型生成唯一标识.只有在没有其他进程往同一张表中插入数据时才能使用. 在集群下不要使用. identity (标识)对DB2,MySQ ...

  4. 如何在高并发的分布式系统中产生UUID

    一.数据库发号器 每一次都请求数据库,通过数据库的自增ID来获取全局唯一ID 对于小系统来说,这是一个简单有效的方案,不过也就不符合讨论情形中的高并发的场景. 首先,数据库自增ID需要锁表 而且,UU ...

  5. 【.NET】XML文件的创建,修改,删除

    类名:XML /// 1.创建XML文档 /// 2.在根节点下增加子元素 /// 3.在元素下增加子元素 /// 4.获取类型为制定值的一组节点 /// 5.抓取网页上的xml文档赋值给XmlDoc ...

  6. 【转】HTML-based script和URL-based script两种脚本录制方式

    在Web(HTTP/HTML)录制中,有2种重要的录制模式.用户该选择那种录制模式呢?HTML-mode录制是缺省也是推荐的录制模式.它录制当前网页中的HTML动作.在录制会话过程中不会录制所有的资源 ...

  7. SDWebImage实现图片缓存

    我之前写过一篇博客,介绍缓存处理的三种方式,其中最难,最麻烦,最占内存资源的还是图片缓存,最近做的项目有大量的图片处理,还是采用了SDWebImage来处理,但是发现之前封装好的代码报错了.研究发现, ...

  8. bzoj1336: [Balkan2002]Alien最小圆覆盖

    题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1336 1336: [Balkan2002]Alien最小圆覆盖 Time Limit: 1 ...

  9. MongoDB数据模型(二)

    原文地址 接上一篇 四.模型树结构 父引用的模型树结构 这个数据模型描述了一个树形结构,在子节点中存储父节点的引用. 模式 父引用模式存储每个树节点到文档中,除了树节点外,文档还存储了父节点的id. ...

  10. Java的I/O总结

    概念:Java语言中数据流是接收和发送数据的管道.流是一位单项的. 流的分类: 按照字节字符:InputStream和OutputStream是字节输入输出流的抽象父类.Reader和Writer是字 ...