We are testing the lowmemorykiller.c driver of android, using a sample
test application that malloc() and memset() memory. [code pasted
below]

void loopmalloc()
{
    int size,i=0;
    float **ptr = NULL;

    printf("\n\nLoopMalloc starts....\n\n");
    ptr = (float **)malloc(2000000*sizeof(float *));
    while(i++ < 2000000)
    {
       printf("LoopMalloc Starts i=%d\n",i);
       size = 1024*1024*1024*sizeof(float);
       ptr[i] = (float *)malloc(size);
       memset(ptr[i],0,size);
    }
}

We configured lowmemorykiller.c to be triggrred for 6 different levels
of freememory

init.rc
write /sys/module/lowmemorykiller/parameters/minfree
1536,2048,4096,5120,5632,6144

Low Memory Killer was not tiggerred for any level of the freememory
mentioned above.

Then we increased the Free Memory Levels, so the sample application is
expected to be triggered at the very beginning as we have configured
the LMK to be triggered even for a very high free memory.

write /sys/module/lowmemorykiller/parameters/minfree
1054720,1054720,1054720,1054720,1054720,1054720

Now the low memory killer is getting called and also the sample test
application is killed by the lowmemorykiller.

But only after the sample application is almost at the end of the
memory allocation.

Is there any patch to lowmemorykiller.c or the kswapd (mm/vmscan.c)
that will make the lowmemorykiller to get triggerred for all levels of
the free memory levels specified inside the init.rc.

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

Reply via email to