在Windows上获取进程内存

时间:2016-01-13 14:49:48

标签: windows command-prompt

我在Ruby中有一个库,用于获取当前进程的内存使用情况,我刚收到一份报告称它在Windows上无法运行。在mac和linux上,我可以向tmux new 'tmux move-window -t 99 \; source-file ~/.tmux/session_octoly' 发送shell以获取PID为3432的进程的RSS内存。在Windows中是否有等效的命令?

1 个答案:

答案 0 :(得分:10)

不确定linux如何测量RSS但在Windows中测量工作集大小(当前驻留在物理内存中的进程的虚拟地址空间中的页面集),您可以使用WMIC来查询WMI:

C:\>wmic process where processid=6884 get WorkingSetSize
WorkingSetSize
253448192

(删除get WorkingSetSize以获取可用指标的列表)