J
John Roberts
Hi,
We are developing a product with Windows CE.NET that uses compact framework
for its UI. I've been impressed with speed, etc, so far, but just started
looking at memory requirements.
We have a form that pops up a menu for the user (this is actually a child
form) which can be dismissed by the user. If the menu is poped up and then
dismissed about 20 times, the application has allocated close to the
available memory (about 24Mb) and thereafter runs out of memory and quits
with an 'out of memory exception'.
It appears that no garbage collection is invoked at all and the app just
dies instead.
However, if an application switch occurs, then a GC does happen and the
memory requirement never rises above a reasonable level.
I've read that application switches trigger GCs, as do various other events.
However, in this scenario the application just eats RAM until it dies and
never GCs. This is surely a flaw in the CF?
By the way, calling GC.Collect() after the popup is dismissed fixes the
problem. There is also no noticable performance hit.
I've read a lot about 'let the GC just do its stuff, it is highly optimised
blah blah' but from my findings, it is clearly not. Perhaps my usage pattern
is unusual. Does anyone else have any similar situations? The popup menu is
implemented as a child form.
- John
We are developing a product with Windows CE.NET that uses compact framework
for its UI. I've been impressed with speed, etc, so far, but just started
looking at memory requirements.
We have a form that pops up a menu for the user (this is actually a child
form) which can be dismissed by the user. If the menu is poped up and then
dismissed about 20 times, the application has allocated close to the
available memory (about 24Mb) and thereafter runs out of memory and quits
with an 'out of memory exception'.
It appears that no garbage collection is invoked at all and the app just
dies instead.
However, if an application switch occurs, then a GC does happen and the
memory requirement never rises above a reasonable level.
I've read that application switches trigger GCs, as do various other events.
However, in this scenario the application just eats RAM until it dies and
never GCs. This is surely a flaw in the CF?
By the way, calling GC.Collect() after the popup is dismissed fixes the
problem. There is also no noticable performance hit.
I've read a lot about 'let the GC just do its stuff, it is highly optimised
blah blah' but from my findings, it is clearly not. Perhaps my usage pattern
is unusual. Does anyone else have any similar situations? The popup menu is
implemented as a child form.
- John