James Gray said: > > > Simon Bryan wrote: >> Hi all, >> Below is part of the 'top' display from one of my servers. Note that it is sorted >> on >> Memory and that the top few use only 1.1% of memory, yet the summary at the top >> would indicate that about 90% or more of memory was in use. >> >> Can anyone give me some possible reasons / fixes for this or am I just reading it >> wrong? >> >> >> 7:47am up 22 days, 18:29, 1 user, load average: 0.12, 0.07, 0.01 >> 139 processes: 138 sleeping, 1 running, 0 zombie, 0 stopped >> CPU states: 0.7% user, 0.3% system, 0.0% nice, 98.8% idle >> Mem: 771132K av, 760852K used, 10280K free, 5740K shrd, 222472K buff >> Swap: 522072K av, 5992K used, 516080K free 166472K cached
> > This looks pretty normal. Notice the "buff" and "cache" are about 217Mb > and 163Mb respectively? The Linux kernel will try and use all the RAM > is can for buffers and cache, after accomodating the programs etc, to > minimise disk/network access (which is much slower than RAM - > naturally). However, if a program needed more space (heap/stack etc) > the kernel will sacrifice buff and/or cache to make room. > > The only time to worry is when you see a lot of swap in use and large > amount of paging activity. This is usually a good sign that either > something has sprung a leak, or that you need more RAM. However, if a > program starts then goes idle for an extended period, the kernel may > well swap it out of RAM to either make space for another program or > allocate more buffers/cache. I'm not that familiar with the actual > complexities of the kernel's memory allocation algorithms but you get > the general idea. OK, thanks for that, I note in the reply from Mike the comment about 'windowish' worrying about RAM usage - I had just finished looking through my WIndows servers memory requirements, which is a different kettle of fish to this. I then noticed that all my Linux servers were in a similar state to this (except one where the virus scanner had gone psycho and never finished - over 5 days 5 different instances of it were still running (the scan shoud take about 10 minutes at 1am in the morning). Killing them off and reconfiguring the virus scanner freed a lot of memory and CPU! Good to keep learning about these things. Cheers -- Simon Bryan IT Manager OLMC Parramatta -- SLUG - Sydney Linux User's Group - http://slug.org.au/ More Info: http://lists.slug.org.au/listinfo/slug
