473,385 Members | 1,829 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Memory Leaks

Hi group,
I have created a User control and whenever I use that usercontrol in a form,
there is a memory leak. When I open and close the form, the form along with
my user control is not disposed. It does execute the dispose methods in my
form and in my usercontrol. I am sure there is something wrong with my
Usercontrol but I am not sure where exactly the problem is. Any suggestions
will be greatly appreciated.
Thanks,
Bhargavan
Nov 16 '05 #1
3 1681
Are you sure that the form and the user control have been freed but the
garbage collector simply hasn't gotten around to cleaning them up?
Just because you call Dispose doesn't mean that the memory will be
released immediately.

Nov 16 '05 #2
Hey Bruce,
I was testing for Memory leaks in my application using a tool called .NET
memory profiler. I open and close a form in my application and then got a
snapshot of the memory usuage of my application. The snapshot showed that my
form and all the controls (including the user control that I created) in my
form were still un disposed. But if I test the same form without my
usercontrol in it, then it works fine (controls and form are disposed). Any
ideas on what might be causing this?
Thanks,
Bhargavan

"Bruce Wood" <br*******@canada.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Are you sure that the form and the user control have been freed but the
garbage collector simply hasn't gotten around to cleaning them up?
Just because you call Dispose doesn't mean that the memory will be
released immediately.

Nov 16 '05 #3
Do you have static members in your user control ?
Does your usercontrol reference the form or an element contained in your
form ?

"Bhargavan" <bh********@yahoo.co.in> a écrit dans le message de
news:%2****************@TK2MSFTNGP09.phx.gbl...
Hey Bruce,
I was testing for Memory leaks in my application using a tool called .NET
memory profiler. I open and close a form in my application and then got a
snapshot of the memory usuage of my application. The snapshot showed that my form and all the controls (including the user control that I created) in my form were still un disposed. But if I test the same form without my
usercontrol in it, then it works fine (controls and form are disposed). Any ideas on what might be causing this?
Thanks,
Bhargavan

"Bruce Wood" <br*******@canada.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Are you sure that the form and the user control have been freed but the
garbage collector simply hasn't gotten around to cleaning them up?
Just because you call Dispose doesn't mean that the memory will be
released immediately.


Nov 16 '05 #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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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,...

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.