9.1 Proposal: Deailing with Low Memory/OOM

Deepak Saxena dsaxena at laptop.org
Wed Oct 22 12:44:50 EDT 2008


I would like to present a short session and faciliate the follow up 
discussion on and dealing with the memory constraints on our system
at an application framework level.

>From my understanding, there are two situations we are running into 
with low memory that need separate solutions:

1) A single running application, Browse for example, chews up lots 
   of memory.  The only real solution I can think of to this is to 
   make the applications and underlying libraries leaner and smarter. :)

2) End users run multiple applications or multiple instances of the
   same application, quickly chewing up system resources.

I would like to primarilly focus on dealing with (2).

I've done a bit of reading on how other low memory systems (cell phones
for example) handle running multiple tasks and would like to propose we 
borrow some of these ideas for Sugar.  In Android for example, when a user
switches between tasks, the framework will tell switched out task to save
enough state such that it can handle being killed while in the background.
The user does not know that a background application is dead and on task
switch back to that application, the framework will restart the application
and tell it that it should restore state and not do a cold startup.  I need
to read more of the Android and Sugar docs before I can have a detailed 
proposal but at a high level my proposal is to add similar smarts to our
framework.  This includes, but is not limited to:

- Adding Sugar APIs to handle cold activity start vs restart from saved 
  state and modifying activites to support these APIs.

- Make the Sugar framework (or some other system component) talk to the
  kernel's OOM interface (/proc/<pid>/oom) to manage what tasks should be 
  killed and ensure the foreground process does not get killed.

What I'm proposing is a form of cooperative multitasking managed at 
the application framework level instead of the core OS level.

~Deepak

-- 
Deepak Saxena - Kernel Developer - dsaxena at laptop.org



More information about the Devel mailing list