Operating System - HP-UX
1758669 Members
2845 Online
108874 Solutions
New Discussion юеВ

Re: Trace memory occupation rate, not utilization rate

 
SOLVED
Go to solution
KD AHN
New Member

Trace memory occupation rate, not utilization rate

Hi all,
I'd like to trace the rate of system's memory occupation (not memory utilization estimated by glance or top utility) for a certain period, to get a sense that we need to buy additional physical memory or expand swap spaces.

How can I get the rate information, that is, ( currently occupied(actually used) memory size / total available memory size).

I think memory utilization of glance or top is a bit different from what I want to trace.

My machine : HP L2000, HP-UX 11.0, 4GB RAM

Any comment will be highly appreciated.

Regards,
KD
2 REPLIES 2
twang
Honored Contributor

Re: Trace memory occupation rate, not utilization rate

How about take a look at the total memory claimed by the system:
#!/bin/ksh
t=0

for i in `UNIX95= ps -e -o vsz=Kbytes -o ruser -o pid,args=Command-Line | sort -rnk1 | grep -v Kbytes | awk '{print $1}'`
do
t=`expr $t + $i`
done
echo "\n In total Memory claimed by the system is $t Kbytes.\n"
Bill Hassell
Honored Contributor
Solution

Re: Trace memory occupation rate, not utilization rate

You can simplify your task: just look at vmstat and the po (page out) column. If it is zero to about 10-20, you have plenty of memory. If po=50+ then more memory is a good idea. If it is 150+ for long periods, you desparately need to double the amount of AM you have.

Memory usasge is very complex. The kernel; uses some memory (perhaps 1-2 dozen megs), the buffer cache may use up to 50% of your RAM (wrong setting in the kernel), processes occupy memory, and most complicated, shared memory in the form of shared memory segments, memory mapped files, shared libraries and shared executables. It is very difficult to add all of this since it changes every few seconds.

However, once the system starts heavy paging (swapping), RAM is too small. If you are running Oracle or Sybase, there are numerous considerations about the configuration of these tools. Oracle can be configured to use several thousand megs of RAM (way more than 4Gb) so a lot depends on how the DBA uses memory and what performance levels are desired.


Bill Hassell, sysadmin