Find the answer to your Linux question:
Results 1 to 7 of 7
we are using Linux Kernel 2.6.28.10 for mips Architecture in a embedded system. We are facing memory leak when we run any application or even if we let the system ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2009
    Posts
    5

    Smile Memory leak in Linux kernel 2.6.28.10


    we are using Linux Kernel 2.6.28.10 for mips Architecture in a embedded system.
    We are facing memory leak when we run any application or even if we let the system idle.

    I am trying various options to identify whether it is because of Kernel or Application/driver/uboot patches which we did porting from 2.6.15.4

    I wrote the small program as following after reading the change log of 2.6.30.5 memory leak fix in fflush to identify whether it is because of fflush

    Int main()
    {
    While(1)
    {
    fflush(stdout);
    }
    }

    After running this program we are seeing memory leak ,within 3 mins memory is reduced from 31000k to 1800k. Once it reaches 1200k the memory is not reducing. we donno why ?

    The same application when we run in 2.6.15.4 kernel there is no memory leak.

    Is there any patches for kernel 2.6.28.10 which fixes this?

    If the above fflush is not causing memory leak. i would like know why the memory is getting reduced after running this program.


    Whether the Kernel 2.628.10 is having any memory leak in the kernel like i suspected above or any memory leak related to network or loopback or something.

    Thanks in advance !

  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,737
    How are you determining that this is a leak?
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  3. #3
    Just Joined!
    Join Date
    Mar 2009
    Posts
    5
    I have seen in the output of the top command. i can able to see that memory is reducing consistently..
    Can you please tell me why its reducing the free memory in the new kernel alone(2.6.28.10) and not in old kernel(2.6.15.4).

  4. $spacer_open
    $spacer_close
  5. #4
    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,737
    Without being able to see what is going on in your system I cannot say with 100% certainty, but it is true that newer kernels do more caching of data, which will lower the perceived amount of available memory. However, as applications require use of the memory, these cached buffers (files, executables, shared libraries, directory entries, etc) will be dropped in a LRU (Least Recently Used) manner.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  6. #5
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    Are you checking the memory using the free command? It could just be storing more in buffer/cache than previously.

  7. #6
    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,737
    coopstah13 has a good point. The output from the free command on my system follows:
    Code:
                 total       used       free     shared    buffers     cached
    Mem:       8010784    7850880     159904          0     176076    6547620
    -/+ buffers/cache:    1127184    6883600
    Swap:     16779884        272   16779612
    As you can see, of 8GB of ram, 6.5GB is cached data.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

  8. #7
    Just Joined!
    Join Date
    Mar 2009
    Posts
    5
    i am checking with top command only. in that field i can able to see memory reducing consistently.
    As Per the sugesstion, i guess i shouldn't assume that would be a leak.
    May be while upgrading kernel they might have added the features like this. i think the /proc/meminfo structure previously doesnt have cache field with it. may be added in new kernel(i refer 2.6.28.10).

Posting Permissions

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