|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Getting memory on HP Unix
Hi,
Anyone know of a command I can use to obtain the memory on an HP UNIX box? On Sun, I could do sar -r but this isn't available on HP. Any ideas? Cheers, J |
|
#2
|
|||
|
|||
|
Code:
swapinfo -t
Kb Kb Kb PCT START/ Kb
TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
dev 2146304 469820 1676484 22% 0 - 1 /dev/vg00/lvol2
dev 1687552 0 1687552 0% 0 - 2 /dev/vg00/lvswap1
dev 1687552 0 1687552 0% 0 - 2 /dev/vg00/lvswap2
reserve - 4836664 -4836664
memory 4786844 4463044 323800 93%
total 10308252 9769528 538724 95% - 0 -
The first entry on the memory line is the total available RAM. This box is in trouble because it has almost no virtual memory left. |
|
#3
|
|||
|
|||
|
Perderabo posted this perl script on unix.com - try it as well:
Code:
#!/usr/contrib/bin/perl
local($PSTAT, $PSTAT_STATIC, $PSTAT_DYNAMIC) = (239, 2, 3);
local($struct_pst) = ("\0" x 156);
local($struct_psd) = ("\0" x 2904);
syscall($PSTAT, $PSTAT_STATIC, $struct_pst, length($struct_pst), 1, 0);
($pages, $psize) = (unpack("x16LL", $struct_pst));
syscall($PSTAT, $PSTAT_DYNAMIC, $struct_psd, length($struct_psd), 1, 0);
$free = unpack("x64L", $struct_psd);
$mb = ($psize / 1024) * $pages;
$mb = $mb / 1024;
printf("Phys Memory:\t%8.2f\n",$mb);
printf("Free Pages: \t%8.0f\n",$free);
$pcfree = 100. * $free /$pages;
$pcused = 100. - $pcfree;
printf("\t%%free %5.2f\n\t%%used %5.2f\n", $pcfree, $pcused);
exit 0;
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Getting memory on HP Unix |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|