


I am developing a software that runs on Windows Mobile 5.0.
This application is very big as a windows mobile application.
It ocupies about 6MB of program memory space when it is running.
And I noticed that, while I am running this program, that only one
other application can run at the same time. If I try to boot
up more applications, Windows Mobile seems to automatically
kill old processes.
e.g. If when I am running my application, I start Bubble Breaker,
minimizes it, then start Solitaire, then usually I should see
both "Bubble Breaker" and "Solitaire" in "Running Programs" list
( Settings -> Memory -> Running Programs). But instead,
I see only "Solitaire". So in this case, "Bubble Breaker" has
been terminated automatically.
I checked the CPU usage and Memory Usage while I am running
my application. CPU usage fluctuated between 20 to 45 (seemed
normal), but Program Memory Usage was around 83% (seemed
extraordinary). So my hypothesis is that when memory usage
exceeds certain amount, Windows Mobile automatically kills
some processes automatically (via LRU?).
I searched on the web for confirmation of my hypothesis, but
so far no luck.
Does someone have concrete knowledge about this situation?
And tell me how I can avoid this situation except for reducing the
size of application?
Yes, that's a well known feature of Windows Mobile. The idea is what OS terminates applications automatically if it runs low on resources, user never terminates anything - applications are minimized instead of been closed.
Upon termination your application will be issued WM_CLOSE message by the OS which would result in closing event firing on your active form which you can ignore by handing this event and setting CancelEventArgs.Cancel to true.
Keep in mind what if application refuses to terminate voluntarily OS can kill the process anyway.
I will try the "Cancel" at first. However, it seems concrete way is only to
physically increase memory space.
Thanks!
