Unfortunately there are no unit test cases; at the end of the day, this is
often a part of tuning the platform and seeing that it is behaving
appropriately in use.

That said, I would really like to have some CTS tests for this.  These are
tricky to do since the guarantees are so loose, but I think some basic stuff
can be done.  For example a test could:

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 is foreground.
 If C starts using memory, A should be killed before B which is killed
before C.  It is tricky however to put this together so it works as a unit
test with dependable behavior.

On Wed, Nov 24, 2010 at 10:37 PM, Raja Pavan <rajain...@gmail.com> wrote:

> Is there any test methodology available from android, for testing LMK
> driver?
>
> On Nov 25, 11:17 am, Dianne Hackborn <hack...@android.com> wrote:
> > There are no guarantees about things being killed at an exact level.  In
> > fact what the current "memory level" is, is quite fuzzy if not just
> outright
> > not knowable.
> >
> > Is there a problem you are trying to address?
> >
> >
> >
> >
> >
> > On Wed, Nov 24, 2010 at 9:49 PM, Raja Pavan <rajain...@gmail.com> wrote:
> > > Hi Dianne
> >
> > > I did run the test application (shared with you) on emulator.
> >
> > > It was killed.
> >
> > > It has been observed that the adb shell is also killed (as it is not
> > > available anymore)
> >
> > > But How do I know whether the process is crashing at the watermark
> > > level?
> >
> > > Thanks
> > > Raja
> >
> > > On Nov 23, 10:19 pm, Dianne Hackborn <hack...@android.com> wrote:
> > > > Have you run your tests on the stock platform (even just the
> emulator) to
> > > > see if you are getting the behavior you expect there?  There are a
> *lot*
> > > of
> > > > potential gotchas if trying to test this behavior: running at the
> right
> > > > oom_adj, fuzziness in the definition of "free memory", etc.  I would
> > > suggest
> > > > validating your test first on a known working build before using it
> to
> > > draw
> > > > conclusions about the  behavior of your own build.
> >
> > > > On Tue, Nov 23, 2010 at 4:45 AM, Raja Pavan <rajain...@gmail.com>
> wrote:
> > > > > We are trying to test Android LowMemoryKiller Driver using a sample
> > > > > test application.
> >
> > > > > /sys/module/lowmemorykiller/parameters/adj 0,1,2,7,14,15
> >
> > > > > MINFREE module parameter is set from the application.
> >
> > > > > echo 1536,2048,4096,5120,5632,6144 >/sys/module/lowmemorykiller/
> > > > > parameters/minfree
> >
> > > > > The test application is pasted at the end of this mail.
> (lowmemTest.c)
> >
> > > > > Expected Behavior: We have set the oom_adj of the lowmemTest.c to
> 13.
> > > > > It is expected to get killed when the free memory in the system (as
> > > > > seen from the putput of free() command is 5120*4*1024 = 20MB .
> >
> > > > > We are printing the free memoy of the system by invoking free()
> inside
> > > > > the lowmemoryTest.c
> >
> > > > > Observed Behavior:
> > > > > (1) But the process is not being killed at the 20MB free memory.
> > > > > (2) This process is getting killed at the free memory close to the
> > > > > min_free_kbytes (/proc/sys/vm/min_free_kbytes)
> >
> > > > > Need Support on these Isssues (Any Patch to kernel)
> >
> > > > > (1) Is there any patch to the linux 2.6.30 kernel (MM or some other
> > > > > subsystem) for getting the desired behavior from lowmemorykiller
> > > > > driver.
> > > > > (2) We have taken the lowmemory killer for this kernel from android
> > > > > git, will this work?
> > > > > (3) Is there any test application available to test the
> > > > > lowmemorykiller, provided by Google?
> > > > > (4) Can some provide us clue about improved debugging of this
> driver?
> >
> > > > > Please extend help ASAP.
> >
> > > > > Thanks
> > > > > Raja
> >
> > > > > --
> > > > > unsubscribe: 
> > > > > android-kernel+unsubscr...@googlegroups.com<android-kernel%2bunsubscr...@googlegroups.com>
> <android-kernel%2bunsubscr...@go­oglegroups.com>
> > > <android-kernel%2bunsubscr...@go­oglegroups.com>
> > > > > website:http://groups.google.com/group/android-kernel
> >
> > > > --
> > > > Dianne Hackborn
> > > > Android framework engineer
> > > > hack...@android.com
> >
> > > > Note: please don't send private questions to me, as I don't have time
> to
> > > > provide private support, and so won't reply to such e-mails.  All
> such
> > > > questions should be posted on public forums, where I and others can
> see
> > > and
> > > > answer them.- Hide quoted text -
> >
> > > > - Show quoted text -
> >
> > > --
> > > unsubscribe: 
> > > android-kernel+unsubscr...@googlegroups.com<android-kernel%2bunsubscr...@googlegroups.com>
> <android-kernel%2bunsubscr...@go­oglegroups.com>
> > > website:http://groups.google.com/group/android-kernel
> >
> > --
> > Dianne Hackborn
> > Android framework engineer
> > hack...@android.com
> >
> > Note: please don't send private questions to me, as I don't have time to
> > provide private support, and so won't reply to such e-mails.  All such
> > questions should be posted on public forums, where I and others can see
> and
> > answer them.- Hide quoted text -
> >
> > - Show quoted text -
>
> --
> unsubscribe: 
> android-kernel+unsubscr...@googlegroups.com<android-kernel%2bunsubscr...@googlegroups.com>
> website: http://groups.google.com/group/android-kernel
>



-- 
Dianne Hackborn
Android framework engineer
hack...@android.com

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
unsubscribe: android-kernel+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-kernel

Reply via email to