Inherent Problems (and Avoiding Them) of the Current Process Shutdown Model in Windows Mobile
This article discusses the problems the process handling engine of the Windows Mobile operating system causes and the cures for that.
As you may already know, the Windows Mobile (WM for short) operating system (OS for short) uses an entirely different process management approach than Windows on the desktop computer.
First, what is a process, you may ask. When you start a stand-alone application, a new process is started. Processes can also be started by the system/other processes too – for example, there're several system processes that are started automatically and always running. I've elaborated on the latter in several of my articles; for example, in this (alternatives:iPAQ HQ, AximSite, PPC Magazine, FirstLoox, BrightHand). See the "Killed op. system process?" section, which, incidentally, is also a highly recommended reading, as far as the subject of the recent article is concerned. It also lists processes that may be safely killed, even by removing from the bootup-related file system/Registry/WinCE database areas.)
The latter, the desktop Windows OS, allows for virtually any number of processes to be run and doesn't automatically shut down any of them. Instead, when you click the X icon in the upper right corner of the frame of the desktop Windows application, the application does get shut down.
The former, the WM OS, however, has an approach diametrically opposed to that of its bigger brother. First, it doesn't shut down the applications if you click the X icon. This is not that big a problem – there're tons of third-party (Magic Button, Spb Pocket Plus etc) and even OEM solutions (see for example the Compaq/HP iTask) for this.
The bigger problem is the following: the OS only lets 32 processes to run at most, including the system services, totally independent of other system resources (CPU usage, memory shortage etc). Even a high-end 128 MByte RAM, 520/624 MHz CPU (which both means they easily could, hardware power-wise!) device can't run more than 10-12 user processes at a time because of this operating system restriction!
This means processes in the Windows Mobile OS are scarce resources. This is why we have to pay extreme attention to keeping the number of them down to avoid the ones that we want to survive be killed.
The 32-processes-at-most threshold means if you just open another application, without minimizing the current (that is, not clicking the X icon), the current application will still be considered minimized and, therefore, in most cases, eligible for termination. This is because you (on the user level) can't just tell the operating system to never kill a process. This can be very important and really annoying in cases like
- running a personal proxy client like Toonel or OnSpeed (see this (alternatives:iPAQ HQ, AximSite, PPC Magazine, FirstLoox, BrightHand) article). The OS can kill these proxy clients any time, causing a lot of trouble (it needs to be restarted and, with Toonel, the proxy settings re-entered/reimported into the Registry, the Internet connection terminated and then reestablished, which with most connection forms can be painfully slow.)
- The same stands for a lot of server applications; for example, if you need to share your Internet connection over Bluetooth PAN. Fortunately, (unlike Java Virtual Machines (JVM's) - see the example of Toonel in the previous bullet -, which haven't been developed for WindowsCE with keeping them unkillable by the OS in mind) some specialized server software, for example, Cambridge Software's excellent two PPC Web/FTP servers, vxWeb (I've tested version 1.0.1 in this respect) and vxFtpSrv (tested version: 1.1.6) will survive this because they explicitly make themselves shutdown-proof (again, unlike most other PPC apps).
- Running an audio recorder application continuously in the background while doing something else in the foreground. (For example, looking up contacts, entering new notes etc). If you start several new tasks and forget to switch back to the audio recorder application regularly, it may be killed by the operating system.
- The same stands for other tasks sent in the background where you not necessarily want them to be shut down but they get killed. For example, you don't necessarily want, for example, reopen previously opened pages/documents and navigate to the previous position – with Pocket Word or Pocket Internet Explorer, the last viewed document will not even automatically be reopened, let alone repositioned to the last position. The same stands for other applications sent in the background, especially where – as with the two above-mentioned examples – the current state isn't saved. For example, if you develop and test, for example, in Java on the Pocket PC, using, for example, one of the console tools I've described in this article (which even made to the Pocket PC Thoughts frontpage as a linked developer article), all you have entered/you've been shown in the console (the commands, the output, everything) will be gone.
A summary of the problem and some generic advice to avoid it
The complete lack of (at least user-level) process control is a real problem with the PPC OS. You should never leave a not-even-minimized process alone for more time than absolutely necessary.
Also, remember NOT to open up Pocket Internet Explorer tabs if you use one of the three process-level, "heavy-weight" PIE plug-ins (Spb Pocket Plus, PIEPlus or MultiIE ) – they all create separate processes for each tab and, therefore, may result in killing minimized processes very easily.
A screenshot example of the process usage of these applications: in the background, you can clearly see that there're several opened MultiIE tabs; in the foreground, the process list of Pocket Contoller, the excellent PPC controller app, is to be seen. The latter shows the running processes on the PPC.
In the above screenshot, you can clearly see that there're one "Internet Explorer" process for each opened MultiIE tabs. (The case would be the same with the two other browser plug-ins.) This is a case that you really want to avoid.
That is,
- don't trust the OS. It may kill your inactive processes even without your actually minimizing them.
- to avoid this case, periodically reactivate these processes
- try to avoid starting excessive numbers of other processes if you do need your background processes to survive
- If you absolutely need to use a tabbed browser with navigating around tons of webpages (and, therefore, you use tons of tabs) while you must also keep your minimized tasks alive, use one of the following, alternative programs (also see the links to the Web browser roundup in the Recommended Readings section) to browse the Net:
1. ftxPBrowser
2. Netfront
3. Minimo
An example process list screenshot with ftxPBrowser:
Do you see the huge difference, compared to the previous case of heavy-weight PIE plug-ins (Spb Pocket Plus, PIEPlus and MultiIE)? Only one process is instantiated, while there're some ten on even more tabs open. This means using alternative, but still tabbed Web browsers and/or the ftxPBrowser PIE plug-in is far more minimized process-friendly than the "traditional" PIE plug-ins.
Recommended reading (if you are interested in using your PDA for web browsing as efficiently as possible): Pocket PC Web browsers - the complete roundup (alternatives: iPAQ HQ (sticky!), AximSite, PPC Magazine, PPCT (frontpage!), BrightHand). I've also collected links to my related articles/posts written after publishing this roundup and posted in these threads – you may also want to read them too.
- Login or Register to post comments
Printer-friendly version



