This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.

Because mobile devices are designed for quick access, developers of the shell for Windows Mobile PDAs simplified the memory interface for users. When an application needs more memory, instead of prompting the user as a desktop computer would, the shell simply shuts down inactive applications without forcing interaction by the user.

The shell optimizes memory use for running applications. When the demand for memory is high, idle applications receive a WM_CLOSEmessage to make room for the active application. Because this automatic shutdown comes without warning, you must handle state persistence within your application if you need to preserve its state from one session to another. Typically, you archive any persistent-state variables to a temporary file after your application receives a WM_CLOSEmessage, but before the message is passed to the operating system. When the application starts, it should immediately check for this temporary file. If the file exists, the application should restore the application state.

To simplify memory management for your users, do not provide a Closebutton on your application's toolbar. Similarly, do not enable Exiton the Filemenu. For more information, see the Design Guidelines.

The following table shows the shell response to low memory at different thresholds.

Threshold Default Value Description


2 MB

The shell sends a Windows Embedded CE WM_HIBERNATE message to the application that has been inactive the longest, and continues to send WM_HIBERNATEmessages to the applications. Once all of the applications have been sent a WM_HIBERNATEmessage, the shell begins sending WM_CLOSEmessages to the applications.

This continues until free memory either climbs above the Hibernation threshold, or falls below the Critical Memory threshold. For more information, see Handling Application Hibernation.


1 MB

The shell sends a WM_CLOSEmessage to the application that has been inactive the longest, and continues sending WM_CLOSEmessages until free memory either climbs above the Critical–Memory threshold, or until only the foreground application remains open.

No Execute

500 KB

No new applications can be opened. For more information about handling memory failure, see System Out of Memory Dialog Box.

The preceding threshold values are for actual devices, and may vary slightly between physical and emulated devices.


Windows Mobile devices should not run multiple instances of an application because doing so requires a large amount of memory, and there is no way for a user to access multiple instances. Instead, an application should be restarted.

An application can have multiple documents open, but you must provide a way for the user to manage and switch between the multiple documents, because this capability is not provided on Windows Mobile devices.

See Also