G
Guest
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
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