How Win CE closes apps at low memory

  • Thread starter Thread starter Tim
  • Start date Start date
T

Tim

WinCE will begin to hibernate or close apps when memory gets low enough.

If the OS sets my Compact Framework app to hibernate, does this kick in the garbage collector?

Does it also close any visible forms?

Is the app still alive, and if so, how do you get back to the app?

If the OS commands the CF app to close during critically low memory conditions, does it close the
entire app vs just closing visible forms (as in the Settings|Memory|Running Programs screen)?

Thanks,
Tim
 
I ran into these problems a while ago and here is what I found

During low memory conditions the OS should send WM_Hibernate and the application should start freeing up as much memory as possible. During criticle memory conditions the OS sends WM_Close and should shut down and save it's state. What I found is the application never gets WM_Hibernate and only gets WM_Close. The only thing I can think of is the framework does not pass on the WM_Hibernate to the app. I also found that forms begin to get Disposed randomly if they are hidden so I assume the framework manually does this. Since this is a managed app you should not have to worry about memory management but when my forms began to get Disposed randomly I had to find out why. Also note my app is fairly big and made for a custom device...probably close to 30-40 forms and I keep telling everyone there is a reason it is called Compact Framework

If you use ApplicationEx from OpenNETCF.org you will be able to trap WM_Close. I could be completly wrong on this as I only spent around 3 hours investigating this. Eventually I will investigate more but if anyone has any insight on this it would be great to know before I start the investigation again

//Mar

----- Tim wrote: ----

WinCE will begin to hibernate or close apps when memory gets low enough

If the OS sets my Compact Framework app to hibernate, does this kick in the garbage collector

Does it also close any visible forms

Is the app still alive, and if so, how do you get back to the app

If the OS commands the CF app to close during critically low memory conditions, does it close th
entire app vs just closing visible forms (as in the Settings|Memory|Running Programs screen)

Thanks
Ti
 
Back
Top