--- In [email protected], "DoOrsOfpErcEpTioN" <[EMAIL PROTECTED]> wrote: > > Upton redhat 9 there was gc (garbage collector), which cleaned memory > of its unused data. > > This was later deprecated and use of cache became prominent and useful. > > When you are checking memory on your server/system use free -m > command. It will show used memory and the cache memory. Even top will > show the same but free will focus only on memory. > > Let me put an o/p here for explanation... > > free -m > total used free shared buffers cached > Mem: 1001 438 563 0 144 186 > > In the above case... > the apparent free memory is --- > (apparent) Free = used - cache > > cache is generally used to improve performance, so that services need > not load content into RAM again and can directly serve from cache. > > So next time you check memory, check the cache value too. > > Regards, > DoOrsOfpErcEpTiON > > > --- In [email protected], "Prashant Karmankar" > <prashantredhat@> wrote: > > > > Hi, > > I am using RHEL5 with 4GB RAM, Its observed that some time server is > > consuming more than 90% Physical Memory however top command shows that > > only jboss is taking 25% and other service is normal. How can i find > > out which other service is consuming memory. Server total cpu load is > > 0.0 to 1.8 , free -m command shows only 300-400 MB memory free, swap > > memory is also 0% utilization. > > > > Prashant > > RedHat Explanation >>>>
http://kbase.redhat.com/faq/FAQ_80_705.shtm Resolution: The philosophy in Linux is that an unused resource is a wasted resource. The kernel therefore will use as much RAM as it can to cache information from your local and remote filesystems/disks. This builds up over time as reads and writes are done on the system trying to keep the data stored in RAM as relevant as possible to the processes that have been running on your system. This caching is reported by the system as the sum of two numbers, buffers and pagecache. The cache is reclaimed, not at the time of process exit (you might start up another process soon that needs the same data), but upon demand - i.e. When you start a process that needs a lot of memory to run, the Linux kernel will reclaim memory that had been storing cached data and give it to the new process. There are some things which get reported as cache which are not directly freeable by the kernel, such as anonymous mmaps and shm regions. These will however, report against all processes attached to them unlike normal cache which is not part of the address space of any running process but is simply a kernel mapping. For example (Units are in megabytes): # free -m total used free shared buffers cached Mem: 1000 900 100 0 350 350 -/+ buffers/cache: 200 800 In this example, as far as applications are concerned the system is using only 200MB of memory and has 800MB free and available for use if needed. The items to note here are: <Physically Used Memory> = <Actual used memory> + <buffers> + <cache> <Physically Free Memory> = <Total Physical Memory> - <Actual used memory> - <buffers> - <cache> <Memory free for Applications> = <Total Physical Memory> - <Actual used memory> <Memory used by Applications> = <Actual used memory> - <buffers> - <cache> Regards Prashant K
