Windows 休眠功能管理

 

Windows 休眠(Hibernate)功能将内存数据保存到 hiberfil.sys 文件中,然后完全关闭电源。重启时从休眠文件恢复数据,实现快速启动和工作状态保存。以此,休眠功能会直接影响快速启动和磁盘空间使用,选择合适的休眠配置可以在系统性能、启动速度和磁盘空间之间找到最佳平衡点。

休眠文件类型

类型 文件大小 功能支持 适用场景
Full = 内存大小 完整休眠 + 快速启动 需要完整休眠功能
Reduced ≈ 内存大小 × 75% 仅快速启动 只需快速启动,节省空间
Disabled 0 无休眠功能 空间紧张,不需要休眠

查看电源状态

检查系统支持的电源模式

powercfg /a

典型输出示例:

The following sleep states are available on this system:
    Standby (S0 Low Power Idle) Network Connected
    Hibernate
    Fast Startup

The following sleep states are not available on this system:
    Standby (S1)
        The system firmware does not support this standby state.
        This standby state is disabled when S0 low power idle is supported.

    Standby (S2)
        The system firmware does not support this standby state.
        This standby state is disabled when S0 low power idle is supported.

    Standby (S3)
        This standby state is disabled when S0 low power idle is supported.

    Hybrid Sleep
        Standby (S3) is not available.

电源状态说明

状态 描述 与休眠的关系
S0 Low Power Idle Modern Standby 模式 不依赖休眠文件
Hibernate (S4) 休眠模式 核心功能,需要休眠文件
Fast Startup 快速启动 依赖休眠文件
Standby (S3) 传统睡眠 不依赖休眠文件
Hybrid Sleep 混合睡眠 结合 S3 和休眠功能

休眠功能管理

启用休眠功能

# 启用休眠功能
powercfg /hibernate on

配置休眠文件大小

# 设置为完整大小
powercfg /hibernate /type full

# 设置为减少大小(推荐)
powercfg /hibernate /type reduced

# 示例输出:
# The hiberfile size has been set to: 3375017984 bytes.

禁用休眠功能

# 完全禁用休眠功能
powercfg /hibernate off

注::禁用休眠功能后,快速启动功能会被禁用。

禁用休眠后的电源状态:

The following sleep states are available on this system:
    Standby (S0 Low Power Idle) Network Connected

The following sleep states are not available on this system:
    Hibernate
        Hibernation has not been enabled.
    Fast Startup
        Hibernation is not available.

常用命令

基础命令

# 查看电源状态
powercfg /a

# 休眠管理
powercfg /hibernate on          # 启用休眠
powercfg /hibernate off         # 禁用休眠
powercfg /hibernate /type full  # 完整大小
powercfg /hibernate /type reduced # 减少大小

# 电源方案管理
powercfg /list                  # 查看所有电源方案
powercfg /getactivescheme       # 查看当前电源方案

诊断命令

# 睡眠诊断
powercfg /requests              # 查看阻止睡眠的程序
powercfg /lastwake              # 查看最后唤醒原因
powercfg /devicequery wake_armed # 查看可唤醒设备

# 报告生成
powercfg /batteryreport         # 生成电池报告(笔记本)
powercfg /sleepstudy            # 生成睡眠研究报告
Next Post Previous Post
No Comment
Add Comment
comment url