一个进程有多少内存被调出?
How much memory of a process is paged out?
是否有性能计数器指示特定进程有多少内存被调出?我有一个有 40 GB 可用 RAM(128 GB 物理内存)的服务器,但调出的数据量超过 100 GB。
我如何才能找出我的哪些进程导致了巨大的页面文件消耗?
也可以进行一些 xperf 跟踪以查看分页 activity 何时发生。但是除了对页面文件的许多写入之外,我看不到内存是从哪个进程写入页面文件的。
Reference Set Tracing 仅向我展示了我所了解的进程的物理内存消耗有多大。但它似乎没有跟踪页面 activity.
更新
OS 是 Windows Server 2012 R2
在 Xperf 中,您想寻找 Hard Faults - note that this is a type of Page Fault,但页面错误通常可以在软件中处理,而无需接触驱动器。您可以在任务管理器中添加一列来显示每个进程的页面错误。
您可以使用 https://technet.microsoft.com/en-us/sysinternals/vmmap.aspx which will tell you for each block of memory in the process address space what type it is, and how much is committed. However, it's the committed memory that can be paged out, and VirtualQueryEx() 之类的工具来获取有关流程的一些信息。
同样值得注意的是,大量的页面调出内存并不总是坏事 - 缓慢的是硬故障。
编辑:嗯,如果你想要一个侵入性的一次性测试,我想有一个 hacky 选项,可以结合 VirtualQueryEx() 和 ReadProcessMemory() 来触及进程中的每个提交页面,这样你就可以计算硬故障!
ETW 提供程序 "Microsoft-Windows-Kernel-Memory"
有关键字 "KERNEL_MEM_KEYWORD_WS_SWAP"
("0x80"
)。这里有一些数据在分页 out/paged in:
时发生的事件
<event value="4" symbol="WorkingSetOutSwapStart" version="0" task="WorkingSetOutSwap" opcode="win:Start" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetOutSwapStartArgs"/>
<event value="4" symbol="WorkingSetOutSwapStart_V1" version="1" task="WorkingSetOutSwap" opcode="win:Start" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetOutSwapStartArgs_V1"/>
<event value="5" symbol="WorkingSetOutSwapStop" version="0" task="WorkingSetOutSwap" opcode="win:Stop" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetOutSwapStopArgs"/>
<event value="5" symbol="WorkingSetOutSwapStop_V1" version="1" task="WorkingSetOutSwap" opcode="win:Stop" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetOutSwapStopArgs_V1"/>
<event value="6" symbol="WorkingSetInSwapStart" version="0" task="WorkingSetInSwap" opcode="win:Start" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetOutSwapStartArgs"/>
<event value="6" symbol="WorkingSetInSwapStart_V1" version="1" task="WorkingSetInSwap" opcode="win:Start" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetOutSwapStartArgs_V1"/>
<event value="7" symbol="WorkingSetInSwapStop" version="0" task="WorkingSetInSwap" opcode="win:Stop" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetInSwapStopArgs"/>
在这里您可以获得一些数据,例如访问的页面数 (PagesProcessed):
<template tid="WorkingSetOutSwapStartArgs">
<data name="ProcessId" inType="win:UInt32"/>
</template>
<template tid="WorkingSetOutSwapStopArgs">
<data name="ProcessId" inType="win:UInt32"/>
<data name="Status" inType="win:HexInt32"/>
<data name="PagesProcessed" inType="win:UInt32"/>
</template>
<template tid="WorkingSetInSwapStopArgs">
<data name="ProcessId" inType="win:UInt32"/>
<data name="Status" inType="win:HexInt32"/>
</template>
<template tid="WorkingSetOutSwapStartArgs_V1">
<data name="ProcessId" inType="win:UInt32"/>
<data name="Flags" inType="win:HexInt32"/>
</template>
<template tid="WorkingSetOutSwapStopArgs_V1">
<data name="ProcessId" inType="win:UInt32"/>
<data name="Status" inType="win:HexInt32"/>
<data name="PagesProcessed" inType="win:Pointer"/>
<data name="WriteCombinePagesProcessed" inType="win:Pointer"/>
<data name="UncachedPagesProcessed" inType="win:Pointer"/>
<data name="CleanPagesProcessed" inType="win:Pointer"/>
</template>
如果它包含您需要的所有数据,请使用它。
是否有性能计数器指示特定进程有多少内存被调出?我有一个有 40 GB 可用 RAM(128 GB 物理内存)的服务器,但调出的数据量超过 100 GB。 我如何才能找出我的哪些进程导致了巨大的页面文件消耗?
也可以进行一些 xperf 跟踪以查看分页 activity 何时发生。但是除了对页面文件的许多写入之外,我看不到内存是从哪个进程写入页面文件的。
Reference Set Tracing 仅向我展示了我所了解的进程的物理内存消耗有多大。但它似乎没有跟踪页面 activity.
更新 OS 是 Windows Server 2012 R2
在 Xperf 中,您想寻找 Hard Faults - note that this is a type of Page Fault,但页面错误通常可以在软件中处理,而无需接触驱动器。您可以在任务管理器中添加一列来显示每个进程的页面错误。
您可以使用 https://technet.microsoft.com/en-us/sysinternals/vmmap.aspx which will tell you for each block of memory in the process address space what type it is, and how much is committed. However, it's the committed memory that can be paged out, and VirtualQueryEx() 之类的工具来获取有关流程的一些信息。
同样值得注意的是,大量的页面调出内存并不总是坏事 - 缓慢的是硬故障。
编辑:嗯,如果你想要一个侵入性的一次性测试,我想有一个 hacky 选项,可以结合 VirtualQueryEx() 和 ReadProcessMemory() 来触及进程中的每个提交页面,这样你就可以计算硬故障!
ETW 提供程序 "Microsoft-Windows-Kernel-Memory"
有关键字 "KERNEL_MEM_KEYWORD_WS_SWAP"
("0x80"
)。这里有一些数据在分页 out/paged in:
<event value="4" symbol="WorkingSetOutSwapStart" version="0" task="WorkingSetOutSwap" opcode="win:Start" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetOutSwapStartArgs"/>
<event value="4" symbol="WorkingSetOutSwapStart_V1" version="1" task="WorkingSetOutSwap" opcode="win:Start" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetOutSwapStartArgs_V1"/>
<event value="5" symbol="WorkingSetOutSwapStop" version="0" task="WorkingSetOutSwap" opcode="win:Stop" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetOutSwapStopArgs"/>
<event value="5" symbol="WorkingSetOutSwapStop_V1" version="1" task="WorkingSetOutSwap" opcode="win:Stop" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetOutSwapStopArgs_V1"/>
<event value="6" symbol="WorkingSetInSwapStart" version="0" task="WorkingSetInSwap" opcode="win:Start" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetOutSwapStartArgs"/>
<event value="6" symbol="WorkingSetInSwapStart_V1" version="1" task="WorkingSetInSwap" opcode="win:Start" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetOutSwapStartArgs_V1"/>
<event value="7" symbol="WorkingSetInSwapStop" version="0" task="WorkingSetInSwap" opcode="win:Stop" level="win:Informational" keywords="KERNEL_MEM_KEYWORD_WS_SWAP" template="WorkingSetInSwapStopArgs"/>
在这里您可以获得一些数据,例如访问的页面数 (PagesProcessed):
<template tid="WorkingSetOutSwapStartArgs">
<data name="ProcessId" inType="win:UInt32"/>
</template>
<template tid="WorkingSetOutSwapStopArgs">
<data name="ProcessId" inType="win:UInt32"/>
<data name="Status" inType="win:HexInt32"/>
<data name="PagesProcessed" inType="win:UInt32"/>
</template>
<template tid="WorkingSetInSwapStopArgs">
<data name="ProcessId" inType="win:UInt32"/>
<data name="Status" inType="win:HexInt32"/>
</template>
<template tid="WorkingSetOutSwapStartArgs_V1">
<data name="ProcessId" inType="win:UInt32"/>
<data name="Flags" inType="win:HexInt32"/>
</template>
<template tid="WorkingSetOutSwapStopArgs_V1">
<data name="ProcessId" inType="win:UInt32"/>
<data name="Status" inType="win:HexInt32"/>
<data name="PagesProcessed" inType="win:Pointer"/>
<data name="WriteCombinePagesProcessed" inType="win:Pointer"/>
<data name="UncachedPagesProcessed" inType="win:Pointer"/>
<data name="CleanPagesProcessed" inType="win:Pointer"/>
</template>
如果它包含您需要的所有数据,请使用它。