Re: Memory Leak due to objects not destroyed
- From: "Alex Feinman [MVP]" <public_news@xxxxxxxxxxxxxxx>
- Date: Thu, 28 Apr 2005 11:54:38 -0700
That form you mention, can you confirm that it's Dispose method is indeed called? Do you perform any cleanup in it? Are there any references to it in other parts of the applications (look for collections)?
--
Alex Feinman
---
Visit http://www.opennetcf.org
"Guillaume C. (France)" <Guillaume C. (France)@discussions.microsoft.com> wrote in message news:D0BEF179-B043-4FCE-8E9F-DA60CFECC853@xxxxxxxxxxxxxxxx
Hi everybody! we developped an .NET CF application, and we experience a memory leak at runtime which continues until having a out of memory. I work on it since a few days, i've been googling a lot to see similar problems, but nothing helped me.
The problem is in fact simple : I have some objects that are never destroyed
nor collected, and i really don't understand why. There is quite a great
number of forms (for an embedded app), about 50 (with a maximum of 5
instanciated at a time), we developped. I logged calls to constructs and
destructors for the forms and some other important objects of the
application. it appears that most forms
are well collected at runtime. But I have one (for what i know) that is
nether destroyed till we exit app. And it seems to be the same for a number
of objects, some of them beeing quite large objects with datatables.
Worst for the form, It can be called in various part of the app, and there
are calls that make the form collected. And the calls are always the same,
something like this :
using (Form myForm = new Form)
{
myForm.ShowDialog();
// Some code using returns of myForm
}
For all that i saw, and i looked for, there are no reference keeped on the form, neither on the other objects i've found they're not collected.
I'm sure Garbage collection is made cause i logged memory usage (GC.GetTotalMemory) and there are fluctuations (and as we are other 1Mo of used RAM, it must be called very often if i understand).
I've succeeded in slowing down memory leak by overriding Dispose(bool disposing) method in all our forms so that they set all referenced objects specifics to the form in it to null, but it was not enough and it results only a more linear curve.
There possibly always are reference(s) to uncollected objects, but i don't know where, and i don't know any meaning to get the information.
Does anyone have some info that could help (a known issue of CF 1.0 SP3, tools to help me found references, anything else...) ?
If you need more info, i can try to give you some. I would have prefered being able to isolate the problem, but it seems to me it's a lot of work.
Thanks to anyone who can help ;).
Guillaume
.
- Follow-Ups:
- Re: Memory Leak due to objects not destroyed
- From: Guillaume C. (France)
- Re: Memory Leak due to objects not destroyed
- From: Stelrad Doulton
- Re: Memory Leak due to objects not destroyed
- References:
- Memory Leak due to objects not destroyed
- From: Guillaume C. (France)
- Memory Leak due to objects not destroyed
- Prev by Date: Re: Memory Leak due to objects not destroyed
- Next by Date: Re: Problem with WaveIn in P/Invoke Example
- Previous by thread: Re: Memory Leak due to objects not destroyed
- Next by thread: Re: Memory Leak due to objects not destroyed
- Index(es):
Relevant Pages
|