需要内存泄漏建议 [英] Memory leak advice needed

查看:54
本文介绍了需要内存泄漏建议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用三维派对组件。在这个组件中,我必须传递对我的

对象的引用。问题是这个组件有一个丑陋的bug。当这个

组件被丢弃时,它错误地不会从其中一个共享中删除对我的

对象的引用lists.And因为操作重复了很多次b / b次泄漏是巨大的。

有没有办法杀死我的物体?

谢谢很多,

Boni

I use 3-d party component. In this component I must pass a reference to my
object. The problem is that this component has an ugly bug.When this
component is disposed, it incorrectly don''t delete the reference to my
object from one of its shared lists.And since the operation repeats many
times the leak is huge.
Is there a way to kill my object anyway?
Thanks a lot,
Boni

推荐答案

" Boni" < oilia @ NOSPAM>在消息中写道

新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
"Boni" <oilia@nospam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
我用三维党组成部分。在这个组件中,我必须传递对我的
对象的引用。问题是这个组件有一个丑陋的bug。当这个
组件被丢弃时,它错误地不会从它的一个共享列表中删除对我的
对象的引用。并且因为该操作重复了许多
时间泄漏是巨大的。
有没有办法杀死我的物体?
非常感谢,
Boni
I use 3-d party component. In this component I must pass a reference to my
object. The problem is that this component has an ugly bug.When this
component is disposed, it incorrectly don''t delete the reference to my
object from one of its shared lists.And since the operation repeats many
times the leak is huge.
Is there a way to kill my object anyway?
Thanks a lot,
Boni




您应该联系该第三方提供商....您是否尝试过将

引用传递给Nothing?取决于第三方组件的工作方式,

将ref传递给Nothing可能会清除循环依赖....然后再次,

它可能会引发错误(你应该能够陷阱)


-

Ken Halter - MS-MVP-VB(来自VB6世界) - http://www.vbsight.com

请保留所有讨论组。



You should contact that 3rd party provider.... have you tried passing a
reference to Nothing? Depending on how that 3rd party component works,
passing a ref to Nothing may clear the circular dependency.... then again,
it may raise an error (which you should be able to trap)

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..


三维派对提供者是Microsoft :)。当我动态创建上下文菜单项时,我正在考虑内存泄漏



http://weblogs.asp.net/pwilson/archi...20/77451.aspx) 。在表格处理之前,它们不会被处理掉。

这是一个记录在案的错误,并且有一个解决方法(使用反射)。

但总的来说,不知怎的,我没有看到garbadge收集的原因。
在开始之前我确信它完全解决了所有内存泄漏问题。但似乎它创造了一类新的内存泄漏问题,

,你必须非常考虑所有的引用。即便如此,由于三维派对的错误,没有保险可以解决问题。

我的意思是,.NET是一个完美的libruary,易于使用。但内存泄漏问题

应该再次修改。目前甚至还没有合适的软件

可以自动检查那些bug'(a-la bounds checker)。对我来说

在c ++中自己杀死所有创建的对象没有问题。有

编码指南,问题很容易管理。但是在.NET中,我通过寻找内存泄漏来花费我所有的时间来花费所有时间,然后调试就更多了。而且,当调试级别可以接受时,我仍然不确定


这只是我的问题还是你们所有人都拥有它?

" Ken Halter" < Ken_Halter@Use_Sparingly_Hotmail.com> schrieb im Newsbeitrag

news:u4 ************** @ tk2msftngp13.phx.gbl ...
The 3-d party provider is Microsoft :). I am speeking about a memory leak
when I create a context menue items dynamically
(http://weblogs.asp.net/pwilson/archi...20/77451.aspx). They are not
disposed until the form is disposed.
It is documented bug and there is a workaround for that (using reflection).
But in general, somehow I don''t see the reason of garbadge collection.
Before I started with it I was sure that it completely solve all memory leak
problems. But it seems, that it creates a new class of memory leak problems,
where you must think very much about all your references. And even then
there is no insurance that something went wrong because of 3-d party bugs.
I mean, .NET is a perfect libruary, easy to use. But the memory leak problem
should be revised once more. Currently there is even no appropriate software
which can automatically check those bug''s (a-la bounds checker). For me
there was no problem to kill all created objects myself in c++. There are
coding guidlines and problem is quite managable. But in .NET I spend all my
time by looking for memory leaks, it is even more time then debugging. And I
am still not sure, when the debug level is acceptable.
Is it only my problem or all of you have it too?

"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> schrieb im Newsbeitrag
news:u4**************@tk2msftngp13.phx.gbl...
" Boni" < oilia @ NOSPAM>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
"Boni" <oilia@nospam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
我使用三维派对零件。在这个组件中,我必须传递对我的
对象的引用。问题是这个组件有一个丑陋的bug。当这个
组件被丢弃时,它错误地不会从它的一个共享列表中删除对我的
对象的引用。并且因为该操作重复了许多
时间泄漏是巨大的。
有没有办法杀死我的物体?
非常感谢,
Boni
I use 3-d party component. In this component I must pass a reference to my
object. The problem is that this component has an ugly bug.When this
component is disposed, it incorrectly don''t delete the reference to my
object from one of its shared lists.And since the operation repeats many
times the leak is huge.
Is there a way to kill my object anyway?
Thanks a lot,
Boni



你应该联系第三方提供商....你试过传递
参考什么?根据第三方组件的工作方式,
将ref传递给Nothing可能会清除循环依赖....然后再次,
它可能会引发错误(你应该能够捕获) http://www.vbsight.com
请将所有讨论保持在小组中..



You should contact that 3rd party provider.... have you tried passing a
reference to Nothing? Depending on how that 3rd party component works,
passing a ref to Nothing may clear the circular dependency.... then again,
it may raise an error (which you should be able to trap)

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..



我看到了MainMenu的一篇MIcrosoft文章中的下面的修复(他们显然也可能与Context Men一样有内存泄漏问题,所以我想b / b
会认为这个修复也适用他们也是,但不确定)


对于任何具有MainMenu组件的表单,添加以下代码使

确保组件被正确处理:

受保护的覆盖子处理(作为布尔值处理)

如果处置

如果组件不是Nothing

组件。 d ispose()

components = Nothing

如果不是mainMenu1什么都没有

a ??要添加的代码

mainMenu1。 Dispose()

mainMenu1 = Nothing

base.Dispose(disposing)

结束如果

结束如果

结束如果


-

Dennis in Houston

" Boni"写道:
I saw the fix below in one of the MIcrosoft articles for MainMenu (they
apparently can also have the same memory leak problems as Context Menus so I
would assume this fix would also apply them them as well but not sure)

For any forms that have MainMenu components, add the following code to make
sure the components are disposed of correctly:
Protected Override Sub Dispose(disposing as boolean)
If disposing
If not components is Nothing
components.Dispose()
components = Nothing
If not mainMenu1 is Nothing
a??Code to add
mainMenu1.Dispose()
mainMenu1 = Nothing
base.Dispose(disposing)
End If
End If
End If

--
Dennis in Houston
"Boni" wrote:
三维派对提供商是微软:)。当我动态创建上下文菜单时,我正在考虑内存泄漏
http://weblogs.asp.net/pwilson/archi...20/77451.aspx) 。在处理表格之前,它们不会被处理。
它是记录在案的错误,并且有一个解决方法(使用反射)。
但总的来说,不知怎的,我没看到收集garbadge的原因。在我开始之前,我确信它完全解决了所有内存泄漏的问题。但似乎它创造了一类新的内存泄漏问题,
你必须非常考虑所有的引用。即便如此,由于三维派对的错误,没有任何保险可以解决问题。
我的意思是,.NET是一个完美的libruary,易于使用。但内存泄漏问题应该再次修改。目前甚至没有合适的软件可以自动检查那些bug(a-la bounds checker)。对我来说
在c ++中自己杀死所有创建的对象没有问题。有编码指南,问题很容易管理。但是在.NET中,我通过寻找内存泄漏来花费我所有的时间,然后调试时间更长。当调试级别可以接受时,我仍然不确定。
只是我的问题或者你们所有人都拥有它吗?

Ken Halter < Ken_Halter@Use_Sparingly_Hotmail.com> schrieb im Newsbeitrag
新闻:u4 ************** @ tk2msftngp13.phx.gbl ...
The 3-d party provider is Microsoft :). I am speeking about a memory leak
when I create a context menue items dynamically
(http://weblogs.asp.net/pwilson/archi...20/77451.aspx). They are not
disposed until the form is disposed.
It is documented bug and there is a workaround for that (using reflection).
But in general, somehow I don''t see the reason of garbadge collection.
Before I started with it I was sure that it completely solve all memory leak
problems. But it seems, that it creates a new class of memory leak problems,
where you must think very much about all your references. And even then
there is no insurance that something went wrong because of 3-d party bugs.
I mean, .NET is a perfect libruary, easy to use. But the memory leak problem
should be revised once more. Currently there is even no appropriate software
which can automatically check those bug''s (a-la bounds checker). For me
there was no problem to kill all created objects myself in c++. There are
coding guidlines and problem is quite managable. But in .NET I spend all my
time by looking for memory leaks, it is even more time then debugging. And I
am still not sure, when the debug level is acceptable.
Is it only my problem or all of you have it too?

"Ken Halter" <Ken_Halter@Use_Sparingly_Hotmail.com> schrieb im Newsbeitrag
news:u4**************@tk2msftngp13.phx.gbl...
" Boni" < oilia @ NOSPAM>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP10.phx.gbl ...
"Boni" <oilia@nospam> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
我使用三维派对零件。在这个组件中,我必须传递对我的
对象的引用。问题是这个组件有一个丑陋的bug。当这个
组件被丢弃时,它错误地不会从它的一个共享列表中删除对我的
对象的引用。并且因为该操作重复了许多
时间泄漏是巨大的。
有没有办法杀死我的物体?
非常感谢,
Boni
I use 3-d party component. In this component I must pass a reference to my
object. The problem is that this component has an ugly bug.When this
component is disposed, it incorrectly don''t delete the reference to my
object from one of its shared lists.And since the operation repeats many
times the leak is huge.
Is there a way to kill my object anyway?
Thanks a lot,
Boni



你应该联系第三方提供商....你试过传递
参考什么?根据第三方组件的工作方式,
将ref传递给Nothing可能会清除循环依赖....然后再次,
它可能会引发错误(你应该能够捕获) http://www.vbsight.com
请保持小组讨论..



You should contact that 3rd party provider.... have you tried passing a
reference to Nothing? Depending on how that 3rd party component works,
passing a ref to Nothing may clear the circular dependency.... then again,
it may raise an error (which you should be able to trap)

--
Ken Halter - MS-MVP-VB (visiting from VB6 world) - http://www.vbsight.com
Please keep all discussions in the groups..




这篇关于需要内存泄漏建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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