Find the answer to your Linux question:
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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just 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]);
    }
    }

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,393
    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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •