!memusage

!memusage 扩展显示有关物理内存使用情况的摘要统计信息。

语法

!memusage [Flags]

参数

标记
可以是下列任何值之一。 默认值为 0x0。

0x0
显示一般摘要信息,以及 PFN 数据库中页面的更详细说明。 有关此类输出的示例,请参阅“备注”部分。

0x1
仅显示有关 PFN 数据库中修改的无写入页的摘要信息。

0x2
仅显示有关 PFN 数据库中修改的无写入页的详细信息。

0x8
仅显示有关内存使用情况的一般摘要信息。

环境

模式:仅内核模式

DLL

Kdexts.dll

其他信息

从内存管理器的页帧编号(PFN)数据库表收集物理内存统计信息。

运行此命令需要很长时间,尤其是在目标计算机以 64 位模式运行时,因为要获取的数据量更大。 在加载 PFN 数据库时,计数器会显示其进度。 若要加快此加载速度,请使用网络连接,或使用 CTRL+A(切换波特率)键提高 COM 端口速度,或使用 .cache(设置缓存大小)命令增加缓存大小(可能约为 10 MB)。

执行本地内核调试时,也可以使用 !memusage 命令。

以下是此扩展的输出示例:

kd> !memusage
loading PFN database
loading (100% complete)
Compiling memory usage data (99% Complete).
             Zeroed:      218 (     872 kb)
               Free:      831 (    3324 kb)
            Standby:   124049 (  496196 kb)
           Modified:    55101 (  220404 kb)
    ModifiedNoWrite:       58 (     232 kb)
       Active/Valid:   321846 ( 1287384 kb)
         Transition:        8 (      32 kb)
         SLIST/Temp:     1533 (    6132 kb)
                Bad:        0 (       0 kb)
            Unknown:        0 (       0 kb)
              TOTAL:   503644 ( 2014576 kb)

Dangling Yes Commit:      184 (     736 kb)
 Dangling No Commit:    81706 (  326824 kb)
  Building kernel map
  Finished building kernel map
Scanning PFN database - (100% complete) 

...

报告中还包括有关调试器可见的内存使用情况的详细信息。

  Usage Summary (in Kb):
Control       Valid Standby Dirty Shared Locked PageTables  name
ffffaf0fb369f010   204    956     0    32   204     0  mapped_file( shell32.dll )
ffffaf0fb369f270   492     60     0   252   492     0  mapped_file( KernelBase.dll )
ffffaf0fb36ad050    20     36     0     0    20     0  mapped_file( WMIsvc.dll )
ffffaf0fb36adad0    88    144     0    40    88     0  mapped_file( Can't read file name buffer at ffffc10e0497e170 )
ffffaf0fb36b5670   780   1012     0   560   780     0  mapped_file( KernelBase.dll )
ffffaf0fb36b5910    44    144     0    28    44     0  mapped_file( cfgmgr32.dll )
ffffaf0fb36bc270     8      0     0     0     8     0  mapped_file( Can't read file name buffer at ffffc10e061a17d0 )
ffffaf0fb36bc520    24     56     0     4    24     0  mapped_file( ShareHost.dll )

...

第一列显示描述每个映射结构的控制区域结构的地址。 使用 !ca 扩展命令显示这些控制区域。

注解

可以使用 !vm 扩展命令分析虚拟内存使用情况。 此扩展通常比 !memusage 更有用。 有关内存管理的详细信息,请参阅由 Pavel Yosifovich、Andrea Allievi、Alex Ionescu、Mark Russinovich 和 David Solomon 编写的 Microsoft Windows 内部资料

!pfn 扩展命令可用于显示 PFN 数据库中的特定页帧条目。

!pool 扩展显示有关特定池分配或整个系统范围的池的信息。