473,466 Members | 1,445 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

VB.NET Memory Leaks

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/libr...isposable.aspx
http://www.java2s.com/Code/VB/Develo...agecollect.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


Sep 5 '08 #1
3 7089
"Sonu" <re*********@hotmail.comwrote in message
news:O2**************@TK2MSFTNGP03.phx.gbl...
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/libr...isposable.aspx
http://www.java2s.com/Code/VB/Develo...agecollect.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.

..NET does not free memory urgently. It uses a garbage collector which may
choose to free up memory when it sees fit. You cannot conclude there is a
memory leak with what you have observed. If there were the memory usage
wouldn't plateua like it is.

--
Anthony Jones - MVP ASP/ASP.NET

Sep 5 '08 #2
Next you will find that if you minimize your application maximize it you
will have a different memory status.
But dont bother trying to minimize your app all the time. - it wont actaully
do anything much.

The Taskbar memory usuage actaully displays a misrepresented memory usage.

Here is a semi-good explination:
http://www.itwriting.com/dotnetmem.php

"Sonu" <re*********@hotmail.comwrote in message
news:O2**************@TK2MSFTNGP03.phx.gbl...
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/libr...isposable.aspx
http://www.java2s.com/Code/VB/Develo...agecollect.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

Sep 5 '08 #3
On Sep 5, 12:50*pm, "Sonu" <replymeo...@hotmail.comwrote:
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/libr...agecollect.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
There may not even be a problem. You said that memory usage as it
appears in Task Manager stops at some point. That's a pretty good
indication that your application is not leaking memory.
Sep 8 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Maurice | last post by:
Hi there, I'm experiencing big memory problems on my webserver. First on an old RedHat 7.2 system, now on an other fresh installed Suse 8.2 system: Linux version 2.4.20-4GB...
0
by: Steve Binney | last post by:
My code makes synchronous HttpWebRequest and HttpRebResponse calls. In VS 2003, I am getting memory leaks and event handle leaks. I am closing all streams and using "using"statements. I have...
4
by: Morten Aune Lyrstad | last post by:
Ok, now I'm officially confused. I have a large project going, which uses a win32 ui library I am developing myself. And I'm getting weird memory leaks. I don't know if I can explain what is going...
2
by: Generic Usenet Account | last post by:
I have been using STL for a long time now, without any problems. Recently we generated a purification report on our software using Rational Purify, and we found some memory leaks. My colleague...
8
by: ranjeet.gupta | last post by:
Dear All Is the Root Cause of the Memory corruption is the Memory leak, ?? suppose If in the code there is Memory leak, Do this may lead to the Memory Corruption while executing the program ? ...
0
by: Frank Lopez | last post by:
Does anyone know if Microsoft generated a whitepaper on this topic? Does anyone know what the solution is? (meaning, eliminate the leak problem -- I am seeing three memory leaks from...
4
by: ali.jan | last post by:
Hi, It is trivial to load an assembly in a new Application Domain. Is there any way of loading an assembly in a new process? I tried using the Process class like this: Process p = new...
23
by: James | last post by:
The following code will create memory leaks!!! using System; using System.Diagnostics; using System.Data; using System.Data.SqlClient; namespace MemoryLeak
3
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". ...
16
by: graham.keellings | last post by:
hi, I'm looking for an open source memory pool. It's for use on an embedded system, if that makes any difference. Something with garbage collection/defragmentation would be nice. It should have...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.