VC ++(MFC)exe占用大量RAM内存 [英] VC++(MFC ) exe takes lots of RAM memory

查看:198
本文介绍了VC ++(MFC)exe占用大量RAM内存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
在Google上搜索了整整一天的时间后,发现"mfc exe内存会消耗大量RAM".找不到有用的内容.
所以像大家一样平常需要专家,


问题当我在PC上运行基于窗口的应用程序时开始运行,这使PC变得异常慢.由于我的2 GB RAM不足,我的exe总共需要500MB RAM.
我的项目架构,
我基于窗口的项目完全依赖MFC动态DLL.
exe根据要求在其中加载DLL.

因此,我需要一个解决方案或至少提示以减少我的exeon RAM的内存消耗.

注意:-
每次加载DLL时,我的exe都会增加RAM上的空间.

感谢

Hi all,
After spending one whole day on google search about "mfc exe memory consumes lots of space of RAM".Nothing useful found.
So as usual need expert like all of you guys,


Problem Start when i run my window based application on my PC.It make my PC incredibly slow.Because out of my 2 GB RAM my exe cosumes 500MB RAM.
My project architecture,
My window based project totally depend on MFC dynamic DLL.
in which exe loads DLL as per requirement.

So i need a solution or at least hint to reduce memory consumption of my exeon RAM.

Note :-
On every loading of DLL my exe increase space on RAM.

thanks

推荐答案

尝试使用内存探查器,请遵循以下链接:
http://stackoverflow.com/questions/818673/memory-profiler-for-c [ ^ ]

http://en.wikipedia.org/wiki/List_of_performance_analysis_tools [
Try using a memory profiler, follow the links below :
http://stackoverflow.com/questions/818673/memory-profiler-for-c[^]

http://en.wikipedia.org/wiki/List_of_performance_analysis_tools[^]


Visual Studio具有内置的内存探查器....

将以下内容放在include语句之后的每个.cpp文件中.

Visual Studio has a built in memory profiler....

Place the following in each of your .cpp files after the include statements.

#ifdef _DEBUG
#define new DEBUG_NEW
#endif




然后在调试器中以调试模式运行您的应用程序.
关闭您的应用程序.

您会在输出窗口中看到这些文件中的所有内存泄漏.
如果泄漏很多,则可能需要一段时间来编译报告.




Then run your application in the debugger in debug mode.
Close your application.

You''ll see any memory leaks from these files, documented in the output window.
If you have a lot of leaks, it may take a while to compile the report.


这篇关于VC ++(MFC)exe占用大量RAM内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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