Skip to content

Clear the UI when memory is critically low

akwizgran requested to merge 1215-low-memory-hide-ui into master

The onLowMemory() callback we've been using to detect low memory situations was superseded by onTrimMemory() in API level 14. The new callback provides more information about the situation.

This branch uses the new callback to clear the UI when system memory is critically low. This releases some memory at the cost of losing the back stack. By the time the system reaches this state, even apps with foreground services are at risk of being killed, so if we don't do something to release memory we may be killed soon.

Partial solution to #1215, but we should keep looking for ways to release memory.

Edited by akwizgran

Merge request reports