Languages and Scripting
Showing results for 
Search instead for 
Did you mean: 

Interpretation of struct __pst_vminfo

Ralph Grothe
Honored Contributor

Interpretation of struct __pst_vminfo

Hi, me again

trying to retrieve memory usage I discovered yet another valuable CPAN module, viz. HPUX::Pstat

This also has a getvminfo() function that is obviously fetching data through pstat() and returns a struct __pst_vminfo which is defined in /usr/include/sys/pstat/vm_pstat_body.h

Unfortunately documentation is sparse.
So I have to deduce from looking in the debugger at the hashref getvminfo() returns what this could mean.
Because the numbers are high (I'm especially interested in the swapouts) I take them as cumulative values.
Thus I think I will have to pull numbers at several intervals and devide by the intervals to get swapout rates.
I guess this is what vmstat command is doing.
However, I get a bit confused again with the member designators (aka hash keys in Perl) between the terms pageouts and swapouts.
The same confusion commands such as vmstat throw because they use a "po" column.
I've learned that nowadays they prefer to use the term paging which denotes transferring of unused memory pages between RAM and disk, as opposed to swapping which denotes transferring of whole processes.
Unfortunately the Perl hash keys don't have exactly the same names as the struct members defined in vm_pstat_body.h
"Documentation" is far from unambigous.

Therefore I grep'ed keys containing the substring "in" or "out" at the end, and would like to ask what they could represent.

This bit of Perl

$ cat

use HPUX::Pstat;

$pst_vminfo = HPUX::Pstat::getvminfo;
@in_out_keys = grep($_ =~/in$|out$/, keys %$pst_vminfo);
printf "%20s => %s\n", $_, $pst_vminfo->{$_} foreach (@in_out_keys);

produced this result

$ ./
psv_spgin => 95637616
psv_tknout => 370464147
psv_spgout => 487643
psv_spswpout => 3583
psv_sswpin => 12513
psv_tknin => 1456797
psv_spgpgout => 1165364
psv_sswpout => 12513
psv_spgpgin => 1578425
psv_spswpin => 677
psv_rpgpgin => 1
psv_rpgpgout => 0



P.S.This thread has been moved from HP-UX>Workload/Resource Management  to HP-UX>  languages- HP Forums Moderator

Madness, thy name is system administration