[android-porting] Re: Low-memory killer and native services

2011-02-16 Thread AppCoder
On Feb 15, 7:44 pm, Dianne Hackborn hack...@android.com wrote: No, it is not, it is done by the OOM killer in the kernel.  It decides what to kill first based on the oom_adj, with higher numbers killed before lower ones.  The foreground process is oom_adj 0, the least needed process is 16,

Re: [android-porting] Re: Low-memory killer and native services

2011-02-16 Thread Dianne Hackborn
The oom_adj set for the process is what determines when the oom killer will kill it. Values 0 are killed after *all* application processes. On Wed, Feb 16, 2011 at 7:42 AM, AppCoder dan.schm...@gmail.com wrote: On Feb 15, 7:44 pm, Dianne Hackborn hack...@android.com wrote: No, it is not,

Re: [android-porting] Re: Low-memory killer and native services

2011-02-16 Thread Dan Schmitt
Ohh, I was expecting oom_adj to have more restrictions, I didn't expect it to be writeable by the process. So it looks like the case is that pretty much any application can just do echo -17 /proc/(mypid)/oom_adj and be unkillable by the oom killer, right, and that's what the original poster

Re: [android-porting] Re: Low-memory killer and native services

2011-02-16 Thread Dianne Hackborn
They should check what their current value is. I am pretty sure init starts with a negative value, so they shouldn't be getting killed by the oom killer. If they are having to manually set this, they probably have something wrong elsewhere. On Wed, Feb 16, 2011 at 5:51 PM, Dan Schmitt

[android-porting] Re: Low-memory killer and native services

2011-02-15 Thread AppCoder
You should be good, the dalvik VM only goes after jvms that it has started. It won't go killing daemons started by init.rc Dan S. On Feb 15, 8:25 am, Chakishante chakisha...@free.fr wrote: Hi, On my platform, I have a native service (launched by init.rc) which is needed to initiate

[android-porting] Re: Low-memory killer and native services

2011-02-15 Thread Srikant
example test: (given in http://groups.google.com/group/android-kernel/browse_thread/thread/c60a585802888a43/5a71d6462cc09072) 1. Start an activity in process A. 2. Start a service in process B. 3. Start another activity in process C. Now process A is a background process, B is a service, and C

[android-porting] Re: Low-memory killer and native services

2011-02-15 Thread Chakishante
So low-mem task killing is performed by Dalvik VM (or Zygote ?), right ? Sounds good, I feel relieved ... Thanks ! Chaki On Feb 15, 6:13 pm, AppCoder dan.schm...@gmail.com wrote: You should be good, the dalvik VM only goes after jvms that it has started.  It won't go killing daemons started

Re: [android-porting] Re: Low-memory killer and native services

2011-02-15 Thread Dianne Hackborn
No, it is not, it is done by the OOM killer in the kernel. It decides what to kill first based on the oom_adj, with higher numbers killed before lower ones. The foreground process is oom_adj 0, the least needed process is 16, system processes are 0. On Tue, Feb 15, 2011 at 9:53 AM, Chakishante