D
Daniel Moth
Hi
I have been experiencing the OOM dialog that CE throws up so I am trying to
diagnose where the leak in my app is (assuming there is one)...
The dialog pops up with the caption "Program Memory is Low". Then there are
options to close a form down or "Convert some Storage Memory to Program
Memory...". I understand this is the OOM component... I would like to handle
this situation in my code rather than have the OS do it not only because
that dialog actually goes beyond our (240x320) screen but because I would
rather reset the unit (or restart the app) if a GC.Collect doesn't help at
that point...
So the questions are:
1. Has anybody else done this before? I understand that I will have remove
the OOM component and then call SetOOMEvent (just changing the registry
values had no effect)... I think I'll pass it a handle and 0s for the
remaining 4 values.. Anybody see a problem with that?
2. Shouldn't I get an OutOfMemoryException when the low memory condition
occurs? Replicating a low memory condition (using the memory slider) always
results in the OOM dialog coming up and never an OutOfMemoryException. Could
it be a case of the dialog popping up before the GC has a chance to collect
the garbage?
Cheers
Daniel
PS This is with CF 1.0 SP2 on own CE 4.2-based device
I have been experiencing the OOM dialog that CE throws up so I am trying to
diagnose where the leak in my app is (assuming there is one)...
The dialog pops up with the caption "Program Memory is Low". Then there are
options to close a form down or "Convert some Storage Memory to Program
Memory...". I understand this is the OOM component... I would like to handle
this situation in my code rather than have the OS do it not only because
that dialog actually goes beyond our (240x320) screen but because I would
rather reset the unit (or restart the app) if a GC.Collect doesn't help at
that point...
So the questions are:
1. Has anybody else done this before? I understand that I will have remove
the OOM component and then call SetOOMEvent (just changing the registry
values had no effect)... I think I'll pass it a handle and 0s for the
remaining 4 values.. Anybody see a problem with that?
2. Shouldn't I get an OutOfMemoryException when the low memory condition
occurs? Replicating a low memory condition (using the memory slider) always
results in the OOM dialog coming up and never an OutOfMemoryException. Could
it be a case of the dialog popping up before the GC has a chance to collect
the garbage?
Cheers
Daniel
PS This is with CF 1.0 SP2 on own CE 4.2-based device