1) Sept. 9, 2012 2) 1 day 3) MC65 4) BSP 40.211 5) 2672603
Customer is seeing application being closed randomly.
This issue is reproducible with default OS when we start different application one after one without being closed, once we reach certain limit some of the previous application being killed.
This seems to be having relation with wm6.5 OS limitation where (only 32 processes can run simultaneously ) , however the partner asked for some clear explanation how this works and if this is by design .
They also asked if there is way to control which application can be killed or not , as in real scenario , business application is being killed
Attached file containing trace logs of the app being executed, the log shows also apps being killed randomly after we run couple of other applications
8 Replies
Attached logs showing that we can not go more than 28 processes with MC65
logs includes emscriptlogs + tasktrace xls
tasktrace app running in device and exporting the current processes list each 5 seconds .
emscript was set to do process snapshot each 10 seconds.
Emscript started 08:29:39 already 24 processes including emscript calc started at 08:21:39 word mobile excel power point one note media player email internet explorer contacts picture and video started 8:34 messenger started 8:34 calendar started 8:37 note started 8:38
we can already see in the logs that at 8:32:49 calc was killed 8:34:00 pwrod was killed and replaced by pimg
same is seen for other apps .
as matter of examples see document processes10vs35.png which shows some of the apps being killed randomly .
Here is some documentation from Microsoft: This explains when/why the change was made: http://msdn.microsoft.com/en-us/library/ff599659.aspx Here is how it can be configured:
Windows Mobile has a hard upper limit of 32 concurrent processes. To avoid process creation failures it also has a mechanism for closing applications when a process threshold is exceeded.
Prior to Windows Mobile 6.5 the threshold was a hard-coded value of 30. As of Windows Mobile 6.5 the threshold default is 28 and the default can be overridden with a registry value, as detailed below.
When the threshold is exceeded, Windows Mobile reduces the number of processes by selecting the best candidate application to shut down. It sends this application a WM_CLOSE message. If that application does not respond to the WM_CLOSE, Windows Mobile will terminate it. Windows Mobile continues to shut down applications in this way until the threshold is no longer exceeded.
The threshold was lowered in Windows Mobile 6.5 because some user actions (e.g., setting the clock or attaching the ActiveSync USB cable) try to create multiple processes. If the number of processes is already at or near the threshold the result can be a creation failure.
Setting the Out-of-Processes Threshold
The HKEY_LOCAL_MACHINE\System\OOM registry key contains the value for setting the out-of-processes threshold.
The following table shows characteristics of the value:
Name
Type
Description
OOPThreshold
DWORD
This optional value is the out-of-processes threshold. The default value is 28.
Thanks John this is exactly the response the partner was looking for, i will give try with registry change and see the result.
customer reply back with following remark , they complain from the fact that on MC65 device starts randomly killing applications when arriving to 28 process on memory at the same time where MC70 pass this and do the same until it arrives to 30 process , hence the partner is asking why they cannot do the same with MC65
Check out the following for an explanation on how the free memory "checking" works in WM: http://blogs.msdn.com/b/windowsmobile/archive/2006/08/16/702746.aspx This will cause applications to be terminated but you should get some warning with WM_HIBERNATE and WM_CLOSE. Running close to the 32 process limit should be avoided as there are system applications that need to run periodically and this could prevent them from launching.
Thanks John for the link and details, I run also test on MP2.0 with mc55A and see the same, the problem is there are no winnings when this occurs, is this normal behavior?
We have seen at times major device instability when the 32 process limit is exceeded. This is a generic limitation of Windows Mobile on any device. Customers MUST take this design limitation into account when architecting their solution.