performance - 一个进程有多少内存被调出?

标签 performance performancecounter xperf

是否有性能计数器指示特定进程的多少内存被调出?我有一台服务器,它有 40 GB 的可用 RAM(128 GB 物理内存),但分页的数据量超过 100 GB。
如何找出我的哪些进程负责该大页面文件消耗?

也可以进行一些 xperf 跟踪以查看页面输出事件何时发生。但是除了对页面文件的许多写入之外,我无法看到内存是从哪些进程写入页面文件的。

引用集跟踪仅向我展示了我的进程的物理内存消耗有多大。但它似乎没有跟踪页面输出事件。

更新
操作系统为 Windows Server 2012 R2

最佳答案

ETW 提供商 "Microsoft-Windows-Kernel-Memory"有关键字 "KERNEL_MEM_KEYWORD_WS_SWAP" ( "0x80" )。这里有一些数据被调出/调入时发生的事件:

     <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>

如果它包含您需要的所有数据,请使用它。

关于performance - 一个进程有多少内存被调出?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38177252/

相关文章:

java - Break 语句会导致执行速度变慢?

python-3.x - 如何减少 rasa 3 python 中的模型加载时间

java - 如何改进抛出 "statement timeout"的 postgresql 请求

c++ - 如何确定 PdhExpandWildCardPath 结果中的主要网络适配器?

winapi - Windows 性能分析器或 xperf 中包含的函数计时

windows - XPerfViewer 与新的 Storport Provider?

Eclipse 与 Netbeans 基准测试

linux - 使用 perf 根据其他事件的发生来获取事件计数

c++ - 浮点运算性能 C++

c# - xperf WinDBG C# .NET 4.5.2 应用程序 - 了解进程转储