Identifying Low-Memory Situations

No matter how efficiently you allocate memory and how efficiently your application uses RAM, your device might run low on memory. At a programming level, a low-memory situation can manifest itself to the application in the following ways:

Note Low-memory situations may be caused indirectly. For example, a call to the CreateWindow function can cause these types of memory failures.

To avoid the problems associated with low memory, Windows CE constantly monitors the amount of memory that is available and tries to prevent low-memory situations from occurring. It does this in several ways:

To recognize a low-memory situation, monitor the return values for your memory allocation functions. The platform you program on may also have additional functions to help you deal with low-memory situations. For more information, see the platform-specific documentation.