Memory Leak

Posted on 2003-03-09
Medium Priority
Last Modified: 2010-04-20
I have 256Mb ram, When syetem boots it is useing 200Mb of ram i have only 50 or 30 Mb ram free. If I use any other application it uses 250Mb of ram, When I stop the app.. it shows 240Mb used ram. Bascily ram is not geting refreshed.

The same for all my Servers, Any one know solution for this, any tool for refresing memory, any patch for kernel?
Question by:vijay_karanth
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Accepted Solution

majorwoo earned 750 total points
ID: 8100893
what is happening is normal.

The way linux uses RAM is that if nothing else is using it, it will cache file writes to the RAM and not write them out until it is needed, that way if you use a certain file alot it is still in memory.

When you look at your free RAM:
[josh@woo josh]$ free
             total       used       free     shared    buffers     cached
Mem:       1030488     311092     719396          0      36668     132168
-/+ buffers/cache:     142256     888232
Swap:      1052216          0    1052216
[josh@woo josh]$

notice that it says (rounding here) 311MB used.  But see also that 36MB is in buffers and 132MB is cached? Those 168MB of RAM are available if anything needs them, but until something does its going to keep using it.
LVL 20

Expert Comment

ID: 8104143
Um, buffers are actually used:-).
Not that important though...
What needs be understood is that (unlike more traditional unices) Linux has an "agressive" file buffer cache strategy that almost always is good.
The very slight overhead of returning cached pages to processes that need RAM is negligeble(sp?), compared to the gain of not needing to read the page from disk.
So just learn to add chache to free before "crying wolf":-).

If you start seeing messages about "OOM" and "killing process ####", you have cause for concern.
Even if you start to see a large utilization of Swap, this mightn't mean you are in danger, but it should be monitored.

You could perhaps post the output of
from during the time you feel you have "tight memory resources"?

Majorwoo is (in other words) very correct (and should be awarded the points, I'm just shooting the breeze:-).

-- Glenn

Expert Comment

ID: 8104327
that is why there is swap wich could also be 100mb
and u also could use free command like the guy told befor

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month10 days, 21 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question