TrimMemory Enum

Definition

Enumerates values returned by several types and taken as a parameter of several types.

public enum TrimMemory
type TrimMemory = 
Inheritance
TrimMemory

Fields

Name Value Description
RunningModerate 5

This constant was deprecated in API level 35. Apps are not notified of this level since API level 34 Level for onTrimMemory(int) : the process is not an expendable background process, but the device is running moderately low on memory. Your running process may want to release some unneeded resources for use elsewhere.

RunningLow 10

This constant was deprecated in API level 35. Apps are not notified of this level since API level 34 Level for onTrimMemory(int) : the process is not an expendable background process, but the device is running low on memory. Your running process should free up unneeded resources to allow that memory to be used elsewhere.

RunningCritical 15

This constant was deprecated in API level 35. Apps are not notified of this level since API level 34 Level for onTrimMemory(int) : the process is not an expendable background process, but the device is running extremely low on memory and is about to not be able to keep any background processes running. Your running process should free up as many non-critical resources as it can to allow that memory to be used elsewhere. The next thing that will happen after this is ComponentCallbacks.onLowMemory() called to report that nothing at all can be kept in the background, a situation that can start to notably impact the user.

UiHidden 20

Level for onTrimMemory(int) : the process had been showing a user interface, and is no longer doing so. Large allocations with the UI should be released at this point to allow memory to be better managed.

Background 40

Level for onTrimMemory(int) : the process has gone on to the LRU list. This is a good opportunity to clean up resources that can efficiently and quickly be re-built if the user returns to the app.

Moderate 60

This constant was deprecated in API level 35. Apps are not notified of this level since API level 34 Level for onTrimMemory(int) : the process is around the middle of the background LRU list; freeing memory can help the system keep other processes running later in the list for better overall performance.

Complete 80

This constant was deprecated in API level 35. Apps are not notified of this level since API level 34 Level for onTrimMemory(int) : the process is nearing the end of the background LRU list, and if more memory isn't found soon it will be killed.

Remarks

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to