1846991 Members
3080 Online
110257 Solutions
New Discussion

Memory Check

 
SOLVED
Go to solution
Allen Karczmarek
Occasional Contributor

Memory Check

Is there a command to check the memory usage on an HP9000. I've got several databases on the box and need to add another. I'm trying to find out how much more memory I have to allocate.

Thanks,
Allen
5 REPLIES 5
Sean OB_1
Honored Contributor
Solution

Re: Memory Check

Top will give you a rough estimate of what is available.

But Glance is the only real way to see what is being used and how much is physically free.
A. Clay Stephenson
Acclaimed Contributor

Re: Memory Check

By far, your best choice is Glance. You can use it to get per process values. If you don't have Glance, you can install a fully functional trial version from your Application CD's. Glance will also show shared memory usage.

You can also use top and ps but these metrics are less accurate and more limited. You must also use ipcs to see shared memory usage but again it's not as directed as Glance is for spotting per process usage.
If it ain't broke, I can fix that.
Allen Karczmarek
Occasional Contributor

Re: Memory Check

Thanks !!!!
steven Burgess_2
Honored Contributor

Re: Memory Check

Hi

vmstat -n 1 1 displays the ammount of free RAM

Script to check free memory

let x=$(grep -i
physical: /var/adm/syslog/syslog.log | head -1 | awk '{print $7}
')/1048
let z=$(vmstat|tail -1|awk '{print $5}')*4096;let z=$z/1000000
let free=100000/$x*$z
let free=$free/1000
let free=100-$free
echo "$x Mb physical memory \n$z Mb memory free \n$free % used"

HTH

Steve
take your time and think things through
MANOJ SRIVASTAVA
Honored Contributor

Re: Memory Check

Hi Allen

here is a simple C program that iI got from the forums whihc can be comipled and can give o/p as :


Memory Stat total used avail %used
physical 32764.0 8058.4 24705.6 25%
active virtual 531.3 128.9 402.4 24%
active real 597.0 136.0 461.0 23%
memory swap 26522.5 3738.2 22784.3 14%
device swap 2378.0 2365.5 12.5 99%


I ahve attached the script

Manoj Srivastava