Results 1 to 2 of 2
Can some one share a test application to test Android Low Memory Killer
The test code pated below is not providing the desired functionality.
(1) It is not killed at ...
- 11-29-2010 #1Just Joined!
- Join Date
- Oct 2007
- Posts
- 14
Android Low Memory Killer
Can some one share a test application to test Android Low Memory Killer
The test code pated below is not providing the desired functionality.
(1) It is not killed at the designated watermark levels. When the free memory in the system is 5632*4*1024 = 22.4 MB
it is killed only when the system memory reaches as low as min_free_kbytes.
system("echo 1536,2048,4096,5120,5632,6144 > /sys/module/lowmemorykiller/parameters/minfree");
sprintf(cmdStr, "echo 13 > /proc/%d/oom_adj", my_pid);
while(i++ < 240) //240 MB Memory
{
size = 256*1024*sizeof(int); //1MB
ptr[i] = (int *)malloc(size);
int *write=ptr[i];
if(ptr[i]!=NULL)
{
size = size/sizeof(int);
//printf("Success in malloc");
while(size--)
*write++=size;
system("/usr/bin/free");
}
else
{
printf("malloc error %d ",ptr[i]);
}
}
- 12-08-2010 #2Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 8,961
Try the Android developers' website/forums for help with this? Yes, Android is a MOSTLY Linux system, but there are a lot of caveats to that statement.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote
