OOM Components and Thresholds (Compact 2013)
3/28/2014
In the new out-of-memory (OOM) design, there are several thresholds, adjustable by using the device registry, which you can use to provide different levels of available memory for different types of components.
The memory allocation algorithm checks the amount of memory remaining against the thresholds of the component requesting the memory.
Types of Components
The new OOM handler determines if a memory allocation should succeed based on what is requesting the memory. The following table describes a list of categories of processes.
Category |
Description |
---|---|
Kernel Internal |
Allocation inside Kernel.dll to keep track of kernel data structures. |
Kernel |
Allocation made by kernel mode components; for example, filesys, gwe, and kernel mode drivers. |
System Process |
Allocations from system processes, typically Program Static Library (PSL) servers; for example, Udevice.exe and Services.exe. |
Foreground Process |
Allocation from the application currently in the foreground, which is the app that the foreground window belongs to. |
Regular Applications |
Applications that are not in the foreground or applications that do not have a window. |
Types of Thresholds
Corresponding to each of the categories, a threshold is defined. Memory allocation that comes from different categories will assume different thresholds. The following table describes the different types of thresholds.
Threshold |
Description |
---|---|
Kernel Panic |
If the available memory is below the threshold of 16 pages, only committing to the kernel stack succeeds. |
Kernel Critical |
If the available memory is below the threshold of 80 pages, only kernel internal allocations succeed. |
Kernel Low |
Adjustable from the device’s registry with a default of 256 pages. If the available memory is below this value, only allocations from the kernel succeed. |
App Critical |
Adjustable from the device’s registry with a default of 512 pages. If available memory is below this value, only system process or kernel mode allocations succeed. |
App Low |
Adjustable from the device’s registry with a default of 1024 pages. If available memory is below this value, only foreground, system, or kernel mode allocations succeed. |
Healthy |
Adjustable from the device’s registry with a default of 2048 pages. Memory state is healthy if available memory is above this value. |
Levels of OOM
The following table shows the memory pressure and low notification signals between the application low and healthy memory levels.
Level |
Description |
---|---|
Memory Pressure |
Signaled when memory is below ‘healthy - (healthy - app_low)/ 8’ (default value of 7.5 MB). This notification means that more than 12.5 percent for memory is between app low and healthy. This is an early notification that your device is close to OOM. Memory allocations from any application still succeed, but available memory is low with only 3.5 MB left before memory allocation starts to fail. |
Memory Low |
Signaled when memory is below ‘app_low + (healthy - app_low)/ 8’ (default value of 4.5MB). This notification means that more than 87.5 percent for memory is between app low and healthy. This is an indication that your device is close to OOM with only 0.5 MB left before memory allocation starts to fail. |