Killing activities when memory gets short

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


On Sat, Aug 7, 2010 at 1:31 PM, Bernie Innocenti <bernie at codewiz.org> 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 ps_mem.py. 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.

cheers,




m
-- 
 martin.langhoff at gmail.com
 martin at laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff


More information about the Devel mailing list