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 ...
- 08-25-2009 #1Just Joined!
- Join Date
- Mar 2009
- Posts
- 5
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 !
- 08-27-2009 #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
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!
- 09-01-2009 #3Just 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).
- 09-01-2009 #4Linux 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
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!
- 09-01-2009 #5
Are you checking the memory using the free command? It could just be storing more in buffer/cache than previously.
- 09-01-2009 #6Linux 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
coopstah13 has a good point. The output from the free command on my system follows:
As you can see, of 8GB of ram, 6.5GB is cached data.Code:total used free shared buffers cached Mem: 8010784 7850880 159904 0 176076 6547620 -/+ buffers/cache: 1127184 6883600 Swap: 16779884 272 16779612
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!
- 09-02-2009 #7Just 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).


Reply With Quote
