检索指定进程的内存使用信息.
#Include <WinAPIEx.au3>
_WinAPI_GetProcessMemoryInfo ( [$PID] )
$PID | [可选参数] 进程 PID. 默认 0, 为当前进程. |
成功: | 返回下列信息数组: |
[0] - 页面错误数. | |
[1] - 工作集峰值字节大小. | |
[2] - 当前工作集字节大小. | |
[3] - 页缓冲池峰值的字节大小. | |
[4] - 当前页缓冲池的字节大小. | |
[5] - 非分页池的字节大小. | |
[6] - 当前非分页池的字节大小. | |
[7] - 当前页面文件空间分配的字节数. | |
[8] - 页面文件空间分配的峰值字节数. | |
[9] - 当前不与其它进程共享的内存字节数. | |
失败: | 返回 0,并设置@error标志为非 0 值. |
在MSDN中搜索
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $Data = _WinAPI_GetProcessMemoryInfo()
ConsoleWrite('Number of page faults: ' & $Data[0] & @CR)
ConsoleWrite('Peak working set size: ' & $Data[1] & ' bytes' & @CR)
ConsoleWrite('Current working set size: ' & $Data[2] & ' bytes' & @CR)
ConsoleWrite('Peak paged pool usage: ' & $Data[3] & ' bytes' & @CR)
ConsoleWrite('Current paged pool usage: ' & $Data[4] & ' bytes' & @CR)
ConsoleWrite('Peak nonpaged pool usage: ' & $Data[5] & ' bytes' & @CR)
ConsoleWrite('Current nonpaged pool usage: ' & $Data[6] & ' bytes' & @CR)
ConsoleWrite('Current space allocated for the pagefile: ' & $Data[7] & ' bytes' & @CR)
ConsoleWrite('Peak space allocated for the pagefile: ' & $Data[8] & ' bytes' & @CR)
ConsoleWrite('Current private space: ' & $Data[9] & ' bytes' & @CR)