second exodous said:
Do you have a Linux server?
I have a Linux server, but the statement about is about my notebook.
second exodous said:
I never have very high use of my memory. I'm sure when I play recent games it goes up but I just use it for desktop use and I never get into swap. Right now I'm running firefox, rhythmbox and the normal stuff like compiz and such, that is basically all I use most of the time and I'm using around 14% of my 4 gigs of memory. I have 2 gigs of swap and have never seen it used, I just keep it around because when I ask Linux gurus they always say keep it around at half your memory just in case.
How do you calculate amount of free memory?
`top` shows 'real mem usage', which is four top lines from `/proc/meminfo`.
Code:
Mem: 3951928k total, 3895204k used, 56724k free, 24248k buffers
But `conky`, for example, treats memory used for buffers and caching as free. I.e:
Code:
#!/bin/sh
MemFree=`cat /proc/meminfo | grep MemFree: | awk '{print $2}' | sed 's/k//'`
MemBuffers=`cat /proc/meminfo | grep Buffers: | awk '{print $2}' | sed 's/k//'`
MemCached=`cat /proc/meminfo | grep ^Cached: | awk '{print $2}' | sed 's/k//'`
MemTotal=`cat /proc/meminfo | grep MemTotal: | awk '{print $2}' | sed 's/k//'`
MemFreePercent=$((100 * ( $MemFree + $MemBuffers + $MemCached ) / $MemTotal ))
echo "Free RAM: $MemFreePercent%";