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

前端之家收集整理的这篇文章主要介绍了我的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等).

原文链接:https://www.f2er.com/windows/364504.html

猜你在找的Windows相关文章