且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

内存泄漏?

更新时间:2022-05-21 15:32:10

Form.Dispose


然后需要一些GC清理前的时间


问候

Fredrik Melin

" David Schwartz" <哒** @ hr-symphony.com>在消息中写道

新闻:ez ************** @ TK2MSFTNGP09.phx.gbl ...
Form.Dispose

Then it takes some time before GC cleans up

Regards
Fredrik Melin
"David Schwartz" <da**@hr-symphony.com> wrote in message
news:ez**************@TK2MSFTNGP09.phx.gbl...
有没有人注意到内存泄漏在他们的VB.NET Windows窗体应用程序?我的
应用程序肯定有一些内存泄漏,所以我做了一个简单的测试,看看它是我的应用程序或VB.NET的东西。

我创建了一个测试应用程序与2个表格。 Form1有一个带有
以下代码的命令按钮:
Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As
System.EventArgs)处理Button1.Click
Dim x作为New Form2
x.Show()
End Sub

观察内存使用情况,我看到当我点击时使用的内存在
10-20K之间上升显示Form2的按钮。当我关闭Form2时,内存无法回收。

关闭表单时是否需要回收内存?

谢谢!
Has anyone noticed memory leaks in their VB.NET Windows Forms apps? My app definitely has some memory leaks, so I did a simple test to see if it was my app or something about VB.NET.

I created a test app with 2 forms. Form1 has a command button with the
following code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim x As New Form2
x.Show()
End Sub

Watching the memory usage, I see that the used memory goes up between 10-20K when I click the button to show Form2. When I close Form2, the memory is
not reclaimed.

Is there something I need to do to reclaim memory when closing a form?

Thanks!



" David Schwartz" &LT;哒** @ hr-symphony.com&GT; schrieb
"David Schwartz" <da**@hr-symphony.com> schrieb

关闭
表单时,我需要做些什么才能回收内存?

Is there something I need to do to reclaim memory when closing a
form?




No.

http: //msdn.microsoft.com/library/en...management.asp

-

Armin


如何报价以及原因:
http:// www。 plig.net/nnq/nquote.html
http ://www.netmeister.org/news/learn2quote.html



No.

http://msdn.microsoft.com/library/en...management.asp
--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html


那么为什么内存没有完全回收?


" Armin Zingler" &LT; AZ ******* @ freenet.de&GT;在消息中写道

news:40 *********************** @ news.freenet.de ...
Then why is the memory not completely reclaimed?

"Armin Zingler" <az*******@freenet.de> wrote in message
news:40***********************@news.freenet.de...
David Schwartz &LT;哒** @ hr-symphony.com&GT; schrieb
"David Schwartz" <da**@hr-symphony.com> schrieb

关闭
表单时,我需要做些什么才能回收内存?


Is there something I need to do to reclaim memory when closing a
form?
No.


http://msdn.microsoft.com/ library / en ... management.asp

Armin

如何报价以及原因:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html