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'.
Hibernate与Sleep的区别的更多相关文章
- 简述 Hibernate 和 JDBC 的区别、优缺点
1.hibernate是一个开源的.采用面向对象的思想实现ORM映射框架,它对jdbc进行了一层封装,对于数据库的连接.关闭.数据的持久化(增删改查).事务的管理都进行了封装,使得程序开发的时候可以用 ...
- Jdbc、Mybatis、Hibernate各自优缺点及区别
文章出处:Jdbc,Mybatis,Hibernate各自优缺点及区别 先比较下jdbc编程和hibernate编程各自的优缺点. 1.JDBC 我们平时使用jdbc进行编程,大致需要下面几个步骤: ...
- 对比JPA 和Hibernate 和 Mybatis的区别
1.JPA.Hibernate.Mybatis简单了解 1.JPA:本身是一种ORM规范,不是ORM框架.由各大ORM框架提供实现. 2.Hibernate:目前最流行的ORM框架,设计灵巧,文档丰富 ...
- Hibernate 和Mybatis的区别
Hibernate 和Mybatis的区别 1.hibernate 入门门槛高,是一个标准的ORM框架(对象关系映射),不需要程序写sql,sql语句自动生成,对sql语句进行优化.修改比较困难. ...
- hibernate和ibatis的区别
通过别人的资料,进行自己关注的一些扼要点的整理 共同点: 1. 不同点:1. 自动化程度上,hibernate是全自动化的orm框架,提供了对象到数据库的完全映射和sql的内部自动生成,其对象映射是指 ...
- jdbc,mybatis,hibernate各自优缺点及区别
先比较下jdbc编程和hibernate编程各自的优缺点. JDBC: 我们平时使用jdbc进行编程,大致需要下面几个步骤: 1,使用jdbc编程需要连接数据库,注册驱动和数据库信息 ...
- hibernate与mybatis的区别和应用场景
mybatis 与 hibernate 的区别和应用场景(转) 1 Hibernate : 标准的ORM(对象关系映射) 框架: 不要用写sql, sql 自动语句生成: 使用Hibernate ...
- hibernate与ibatis的区别
Hibernate 是当前最流行的O/R mapping框架,当前版本是3.05.它出身于sf.net,现在已经成为Jboss的一部分了 iBATIS 是另外一种优秀的O/R mapping框架,当前 ...
- Mybites和hibernate的优缺点和区别
Hibernate 是当前最流行的O/R mapping框架,它出身于sf.net,现在已经成为Jboss的一部分. Mybatis 是另外一种优秀的O/R mapping框架.目前属于apache的 ...
- Hibernate get load的区别
这两个函数都是用来从数据库中加载对象,其区别说起来主要有以下两点: 1.如果数据库中不存在该对象,那么load是抛出一个ObjectNotFound的异常,而get是返回一个空指针 2.加载机制不同 ...
随机推荐
- MYSQL 主从复制(NIOT)
一.主数据库操作设置(A) 1.修改配置文件,vim /etc/my.cnf,然后重启mysqld,/etc/init.d/mysqld restart [mysqld]<要在mysqld中括号 ...
- Framebuffer原理、使用、测试系列文章,非常好的资料,大家一起学习
转载:http://blog.csdn.net/tju355/article/details/6881372 *一.FrameBuffer的原理* FrameBuffer 是出现在 2.2.xx 内核 ...
- @Autowired与 @Resource
@Autowired, @Resource 1.注解类型: Autowired可用于构造器.属性.方法.注解 @Target({ElementType.CONSTRUCTOR, ElementType ...
- dump报文转换为wrieshark报文
我们开发中经常会出原始的报文,如下所示: 45 00 01 3d 8e 6a 00 00 80 11 ab 46 00 00 00 00 ff ff ff ff 00 44 00 43 01 29 6 ...
- 第一百零三节,JavaScript对象和数组
JavaScript对象和数组 学习要点: 1.Object类型 2.Array类型 3.对象中的方法 什么是对象,其实就是一种类型,即引用类型.而对象的值就是引用类型的实例.在ECMAScript中 ...
- Spring Security(12)——Remember-Me功能
目录 1.1 概述 1.2 基于简单加密token的方法 1.3 基于持久化token的方法 1.4 Remember-Me相关接口和实现类 1.4.1 Toke ...
- 如何解决两个li之间的缝隙
如何解决两个li之间的缝隙的问题: 在做一个类似按钮左右滑动的选择器的动效,遇到了个是关于li之间的缝隙的问题: HTML如下: <span class="c1mChanger&quo ...
- Java 集合 LinkedList的ListIterator
Java 集合 LinkedList的ListIterator @author ixenos 摘要:ListIterator<E>是继承自Iterator<E>的接口.list ...
- CSS3 学习小结
写样式时有时遇到浏览器兼容问题:-webkit-transition:chrome和safari-moz-transition:firefox-ms-transition:IE-o-transitio ...
- CentOS 修改主机名
最新文章:Virson's Blog 1.临时修改主机名 地址:http://www.cnblogs.com/mawanglin2008/p/3530790.html 显示主机名: oracle@lo ...