Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


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

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

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Question has a verified solution.

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

Over the last ten+ years I have seen Linux configuration tools come and go. In the early days there was the tried-and-true, all-powerful linuxconf that many thought would remain the one and only Linux configuration tool until the end of times. Well,…
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.:
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Suggested Courses

571 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