[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-developers] raq4 memory problem...



On Fri, Aug 16, 2002 at 09:22:02AM -0400, njd76 mentioned:
> I have this same problem after I installed the Hardening Pkg and MySQL.
> I just added another 128 and I am getting the same problem it still
> brings me to 6k of memory! Then when I go to the GUI interface it has
> completely different numbers!!!

 Ah. On linux, 'free' RAM is wasted ram. Linux uses spare ram for
buffering disk access and caching network traffic etc.

 This is a nice little script I use in conjunction with ucd-snmp and Cacti
to monitor real free ram.

 It should be noted that this will produce a negative answer if you are
using swap more than buffers/cache. Linux will swap out programs that
don't run, so it can use that program RAM for caching disk access!

#!/bin/sh
physical=`grep Mem: /proc/meminfo  | awk '{print $2}'`
used=`grep Mem: /proc/meminfo  | awk '{print $3}'`
buffers=`grep Mem: /proc/meminfo  | awk '{print $6}'`
cache=`grep Mem: /proc/meminfo  | awk '{print $7}'`
swapused=`grep Swap: /proc/meminfo  | awk '{print $3}'`
echo "$physical - $used + $cache + $buffers - $swapused" | bc

John