VB.NET Memory Leaks

S

Sonu

Hello -

I have the following code in my vb.net app and when it runs, the memory
usage at the Windows Task Manager keeps increasing for the application and
stops after a while. I'm using some bitmaps and sound in the program.

How would I stop the size thing to increase! I went to these link already
but I cannot fix this issue.
http://msdn.microsoft.com/en-us/library/system.idisposable.aspx
http://www.java2s.com/Code/VB/Development/Forceagarbagecollect.htm

Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
GC.SuppressFinalize(Me)
End If
MyBase.Dispose(disposing)
End Sub

Protected Overrides Sub Finalize()
MyBase.Finalize()
Dispose()
End Sub

Any help would be greatly apprecited with a sample code.

Thanks,
Sonu
 
A

Anthony Jones

Sonu said:
Hello -

I have the following code in my vb.net app and when it runs, the memory
usage at the Windows Task Manager keeps increasing for the application and
stops after a while. I'm using some bitmaps and sound in the program.

How would I stop the size thing to increase! I went to these link already
but I cannot fix this issue.
http://msdn.microsoft.com/en-us/library/system.idisposable.aspx
http://www.java2s.com/Code/VB/Development/Forceagarbagecollect.htm

Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
GC.SuppressFinalize(Me)
End If
MyBase.Dispose(disposing)
End Sub

Protected Overrides Sub Finalize()
MyBase.Finalize()
Dispose()
End Sub

Any help would be greatly apprecited with a sample code.

Please don't multi-post. Answered in dotnet.general
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top