我的Windows应用程序真正使用了多少内存?

我有一个长期记忆的实验程序,我想知道它的实际内存占用量.任务管理器说(在 windows7-64中)该应用程序正在消耗800 MB的内存,但根据任务管理器分配的内存总量为3.7 GB.所有已分配内存的总和不等于3.7gb.如何在运行中确定应用程序实际消耗的内存量.

推论:任务管理器实际报告的内存是什么?它似乎并不是分配给应用程序本身的所有内存.

据我了解,任务管理器显示工作集;

working set: The set of memory pages
recently touched by the threads of a
process. If free memory in the
computer is above a threshold,pages
are left in the working set of a
process even if they are not being
used. When free memory falls below a
threshold,pages are trimmed from the
working set.

通过http://msdn.microsoft.com/en-us/library/cc432779(PROT.10).aspx

您也可以让任务管理器显示虚拟内存.

我通常使用perfmon(Start – > Run … – > perfmon)来跟踪内存使用情况,使用Private Bytes计数器.它反映了您的普通分配器分配的内存(new / HeapAlloc / malloc等).

相关文章

Windows2012R2备用域控搭建 前置操作 域控主域控的主dns:自...
主域控角色迁移和夺取(转载) 转载自:http://yupeizhi.blo...
Windows2012R2 NTP时间同步 Windows2012R2里没有了internet时...
Windows注册表操作基础代码 Windows下对注册表进行操作使用的...
黑客常用WinAPI函数整理之前的博客写了很多关于Windows编程的...
一个简单的Windows Socket可复用框架说起网络编程,无非是建...