我的Windows应用程序实际使用了多少内存? [英] How much memory is my windows app really using?

查看:118
本文介绍了我的Windows应用程序实际使用了多少内存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a long-running memory hog of an experimental program, and I'd like to know it's actual memory footprint. The Task Manager says (in windows7-64) that the app is consuming 800 mb of memory, but the total amount of memory allocated, also according to the task manager, is 3.7gb. The sum of all the allocated memory does not equal 3.7gb. How can I determine, on the fly, how much memory my application is actually consuming.

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

Corollary: What memory is the task manager actually reporting? It doesn't seem to be all the memory that's allocated to the app itself.

推荐答案

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

As I understand it, Task manager shows the Working Set;

工作集:内存页面集 最近被a的线程所感动 过程.如果空闲内存在 计算机超出阈值,页面 留在一个 即使他们没有被处理 用过的.当可用内存低于a 阈值,页面从 工作集.

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

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

You can get Task Manager to show Virtual Memory as well.

我通常使用perfmon(开始->运行...-> perfmon)来通过Private Bytes计数器跟踪内存使用情况.它反映了您的普通分配器(new/HeapAlloc/malloc等)分配的内存.

I usually use perfmon (Start -> Run... -> perfmon) to track memory usage, using the Private Bytes counter. It reflects memory allocated by your normal allocators (new/HeapAlloc/malloc, etc).

这篇关于我的Windows应用程序实际使用了多少内存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆