Operating System - HP-UX
1834742 Members
2817 Online
110070 Solutions
New Discussion

memory utilization with SAR

 
SOLVED
Go to solution
Mark Harshman_1
Regular Advisor

memory utilization with SAR

is there a way to get memory utilization out of sar files? i've looked but cant seem to find it. I'm running HPUX11i. thanks
Never underestimate the power of stupid people in large groups
6 REPLIES 6
Pete Randall
Outstanding Contributor

Re: memory utilization with SAR

Mark,

I don't believe so. I've never seen it.


Pete

Pete
Geoff Wild
Honored Contributor
Solution

Re: memory utilization with SAR

Nope...no memory stats in sar...

Glance, Top, perfview/Measure Ware will do.

I do this daily:

/opt/perf/bin/extract -xp -r /home/gwild/zgbltemplate -g -b today 7:00 -e today 18:00 -f stdout | /bin/mailx -s 'Myserver performance report' gwild@mydomaiin.com



# cat /home/gwild/zgbltemplate
REPORT "MWA Export on !SYSTEM_ID"
FORMAT ASCII
HEADINGS ON
SEPARATOR="|"
SUMMARY=60
MISSING=0
DATA TYPE GLOBAL
YEAR
DATE
TIME
GBL_CPU_TOTAL_UTIL
GBL_MEM_UTIL
GBL_SWAP_SPACE_UTIL
GBL_MEM_CACHE_HIT_PCT
GBL_DISK_UTIL_PEAK
GBL_FS_SPACE_UTIL_PEAK
GBL_MEM_PAGEOUT_RATE
GBL_MEM_SWAPOUT_RATE
GBL_MEM_QUEUE


I also use a compile program called memdetail

# memdetail
Memory Stat total used avail %used
physical 10080.0 10039.4 40.6 100%
active virtual 13168.3 5106.1 8062.2 39%
active real 7732.3 2602.9 5129.4 34%
memory swap 7693.0 1650.4 6042.6 21%
device swap 26528.0 12504.2 14023.8 47%

I attached the c code.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Geoff Wild
Honored Contributor

Re: memory utilization with SAR

Oh - you can use vmstat...

And here's a script:

# cat memused
#!/bin/sh
typeset -i free used total percent
free=`vmstat 1 2 | tail -1 | awk '{print ($5*4)/1024}'`
total=`echo 'phys_mem_pages/D'|adb /stand/vmunix /dev/kmem|grep pages | tail -1 | awk '{print $2*4/1024}'`
((used=$total-$free))
((percent=$used *100 / $total ))
print "used memory: $percent%"


Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Sameer_Nirmal
Honored Contributor

Re: memory utilization with SAR

No. Sar can't be used at all for getting memory utilization.

vmstat should be used instead. It show free physical memory in terms of pages. Multiply that number by the system page size (usually it is 4096 bytes )to get free memory. Then run dmesg, it shows the page size as well alongwith other physical memory details.


Mark Harshman_1
Regular Advisor

Re: memory utilization with SAR

thanks for all the good info.
Never underestimate the power of stupid people in large groups
Borislav Perkov
Respected Contributor

Re: memory utilization with SAR

Hi,
Notify that if you used vmstat you must exclude the first line from its output because it is not valid presentation.
Regards,
Borislav