默认的Win32项目具有恒定的内存泄漏数 [英] Default Win32 project has constant number of memory leaks
问题描述
介绍和相关信息:
我工作的原始项目内存泄漏很少,所以我决定进行一个小测试,这样我就能发现可能导致它们的原因。
我创建了一个 Win32项目
使用 Visual Studio向导
。 我没有添加任何内容,我刚刚离开它,因为它是使用向导创建的。我使用了工具 GDIView
( http://www.nirsoft。 net / utils / gdi_handles.html [ ^ ])看看是否有任何固有的 GDI泄漏
。
问题:
每次调整窗口大小时,此工具都显示我的应用程序泄漏了+3个区域。
我努力解决问题:
项目以来是由Visual Studio向导创建的,我试图从头开始创建一个简单的项目,但是出现了相同的+3个区域。
阅读一些关于<$的文章c $ c> CodeProject 关于我曾经偶然发现一些演示应用程序的区域。
当我打开 GDIView
这些应用程序还泄漏+3个区域。
当我打开任务管理器
以查看是否确实发生了小内存泄漏时,所有这些都得到了验证 - 它确实发生了因为无论我调整窗口大小多少次,内存稍微上升并且之后保持不变。
I使用 Microsoft Visual Studio 2008 Express Edition
,但在常规Visual Studio 2008
中创建空项目时检测到问题好吧。
我在 Windows XP
上工作,但在 Windows上也会出现同样的效果7
。
问题:
为什么会发生这种情况以及如何消除这些小内存泄漏?
谢谢。
最好的问候。
INTRODUCTION AND RELEVANT INFORMATION:
The original project I work on has small memory leaks, so I have decided to perform a small test so I can detect what could cause them.
I have created a Win32 project
using Visual Studio wizard
. I haven't added anything, I have just left it as it was created with the wizard. I have used the tool GDIView
( http://www.nirsoft.net/utils/gdi_handles.html[^] ) to see if there are any inherent GDI leaks
.
PROBLEM:
Each time I resize the window, this tool shows that there are +3 regions that my application leaks.
MY EFFORTS TO SOLVE THE PROBLEM:
Since the project was made by the Visual Studio wizard, I have tried to create a simple project from scratch, but the same +3 regions appear.
Reading through some articles on CodeProject
about regions I have stumbled upon some demo applications that demonstrate the usage of them.
When I turn on GDIView
these applications also leak +3 regions.
All of this is verified when I turn on Task Manager
to see if the small memory leak is really occurring-it does occur since the memory slightly rises and stays constant afterwards no matter how many times I resize the window.
I use Microsoft Visual Studio 2008 Express Edition
, but the problem was detected when empty project is created in regular Visual Studio 2008
as well.
I work on Windows XP
, but the same effect happens on Windows 7
.
QUESTION:
Why is this happening and how to eliminate these small memory leaks?
Thank you.
Best regards.
推荐答案
我不想偷别人的学分,所以我在这里发布一个答案的链接,我认为解释的很好问题是:
http://stackoverflow.com/ questions / 20664677 / default-win32-project-has-constant-of-memory-leaks [ ^ ]
I do not wish to steal other people's credits so I post here a link to the answer that I think explains really well what is the problem:
http://stackoverflow.com/questions/20664677/default-win32-project-has-constant-number-of-memory-leaks[^]
这篇关于默认的Win32项目具有恒定的内存泄漏数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!