System Out of Memory Dialog Box

Windows CE displays a System Out of Memory dialog box in some low-memory situations. This dialog box informs the user that memory is critically low and prompts the user either to close applications or to increase the amount of RAM allocated to program memory. This dialog box is a special System Modal dialog box that freezes the rest of the system. When it is invoked, socket connections stop functioning and other threads stop running.

After the System Out of Memory dialog box closes, any applications selected by the user are shut down just as if the Close button had been chosen. Applications have eight seconds to close. If more memory is requested after four seconds have passed and memory is still critically low, the dialog box reappears.

Note The success of an approach that sends a WM_CLOSE message when memory is low depends on the ability of an application to shut down in response, while allocating little additional memory in the process. If your application requires a significant amount of memory to shut down, try caching the needed memory. For example, you could hide a Do You Want to Save Your Document dialog box, and then make it visible if you need to close the application unexpectedly.