Killing activities when memory gets short

Martin Langhoff martin.langhoff at
Sat Aug 7 19:26:38 EDT 2010

On Sat, Aug 7, 2010 at 1:31 PM, Bernie Innocenti <bernie at> wrote:
> El Sat, 07-08-2010 a las 18:14 +0200, Tomeu Vizoso escribió:
>> So we would have a periodic wakeup? The test would be the amount of
>> free memory plus buffers and caches?
> A polled design is clearly inferior to a proper notification system, but

I think we can just win big time without polling and without killing.

 - grab the python code from We' ll be reading mem usage
from our own processes (w/o rainbow at least) so I suspect no need for
priv operation

 - when the user opens a new activity, poll used/free memory with some
pre-set constants and if warranted send a 'close' signal to the best
candidate (weighed LRU + mem usage score)

 -- depends on closing without asking for a document name...

 - Opportunistic checks on activity switch, view change can complement this.

The above matches what my Android phone does and as a user, works great.


 martin.langhoff at
 martin at -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first

More information about the Devel mailing list