Obtain Memory on HP UNIX


 
Thread Tools Search this Thread
Operating Systems HP-UX Obtain Memory on HP UNIX
# 1  
Old 10-06-2005
Obtain Memory on HP UNIX

Hi,

Does anyone know an easy way of getting the memory usage on a UNIX box? I basically want to find the total % available/in use. Running vmstat gives me 'avm' and 'free' but come in bytes and not percents. Didn't see a switch in sar that just gave me the memory stats similar to Sun's -r command.

Oh, and I need it to come one one line (like sar or vmstat).

Cheers,
J
# 2  
Old 10-24-2005
Bug I am looking for the same....

Currently, we are looking for something that does exactly what you say... Smilie

If you find something or i ... please be in touch. Regards.
# 3  
Old 10-27-2005
Hi,

Have not found anything. Any luck on your side?

J
# 4  
Old 10-28-2005
Glance PLUS is going to do what you need, but you'll have to pay for it depending of the version of HP-UX you have. I know that it comes with the Enterprise OE version of HP-UX but you have to buy a pack for Foundation OE version.

Code:
 GlancePlus C.03.85.00          09:51:39     xxxx     ia64    Current  Avg  High
--------------------------------------44----------------------------------------
CPU  Util   SSSSSSUUUUUU                                       | 24%   24%   24%
Disk Util   FFFFFFFFFFF                                        | 21%   23%   24%
Mem  Util   SSSSSSSSSSSSFFFFSSSSSSSSSSSSSSSSSSUUUUUUUUUUBBB    | 32%   21%   32%
Swap Util   UUUUUUUUUUUUUUUUUUUURRRRRRRR                       | 54%   54%   54%
--------------------------------------------------------------------------------
                                  PROCESS LIST                      Users=  312
                              User      CPU Util     Cum     Disk           Thd
Process Name   PID   PPID Pri Name   (  400% max)    CPU   IO Rate    RSS   Cnt
--------------------------------------------------------------------------------
xxxxxxx       8449      1 168 xxxx     42.2/21.7  7489.5  0.2/ 0.0   1.2mb    1
xx           26306  25776 198 xxxx     18.7/19.9  6877.4  0.0/99.0   1.9mb    1
xxxxxxx       8306      1 185 xxxx      1.8/19.9  6879.1  343/99.2   1.2mb    1
xx           24642  24641 148 xxxx      1.5/ 0.8    37.0  229/14.3   2.3mb    1
xx xx        15611  15610 154 xxxx      1.1/ 0.0     1.5  8.7/ 0.3   2.1mb    1
xxxxxxxx      1876      1 -16 xxxx      0.8/ 0.4  9881.3  0.0/ 0.0  22.3mb    2
xx            8066   8065 154 xxxx      0.6/ 0.0     0.6  6.8/ 0.1   2.7mb    1
xx            9621   9620 154 xxxx      0.6/ 0.0     2.7  8.7/ 0.2   3.7mb    1
xxxxxxxx      3742   3739 154 xxxx      0.4/ 0.1     0.3  3.4/ 0.0  21.8mb    2
xx            8332   8331 154 xxxx      0.4/ 0.2     3.7  2.1/ 0.8   3.5mb    1
xx           26653  26651 154 xxxx      0.4/ 0.0     1.2  7.6/ 0.1   5.0mb    1
xxxx         17820  17819 148 xxxx       0.2/ 0.5 11723.1 38.5/ 0.4   3.1mb   71
xxxxx           53      0 134 xxxx       0.0/ 4.3  100794 15.8/30.4  11.4mb   46
                                          0               9.5                 2

# 5  
Old 10-30-2005
PxT pioneered a technique involving invoking pstat from perl. I have been studying the technique in preparation for a script I plan to write. I have tried to write a script to solve your requirement. I may have succeeded. I have only tested it on one system. The total physical memory matches what I from cstm. Free memory matches what I get from vmstat. And the percentages match what I get from glance. So it may be working. But no guarantees. Smilie
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;
print "Physical Memory: ",$mb,"MB\n";
print "Free Pages: ", $free, "\n";
$pcfree = 100. * $free /$pages;
$pcused = 100. - $pcfree;
printf(" %0.2f%% free          %0.2f%% used \n", $pcfree, $pcused);
exit 0;

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Virtual Memory in UNIX

So, I would ask you a piece of advice about which books or titles could give me comprehensive information about virtual memory in UNIX. Especially, I would found out that virtual address translation corresponds structures of kernel! Thanks! (2 Replies)
Discussion started by: Fadedfate
2 Replies

2. Shell Programming and Scripting

How to extend memory in UNIX?

Hi friends iam new to unix. how to extend memory in UNIx. what are the possible scenarios to increase memory. I just noticed we have swap memory also but when and how to use it. and what is the correct way to increase RAM. please provide information or some useful commands. Thanks (2 Replies)
Discussion started by: saidesh
2 Replies

3. UNIX for Dummies Questions & Answers

UNIX Memory

what is the difference between cached and buffer memory? can i use either buffer or cached memory if i want to run an application? (1 Reply)
Discussion started by: erin00
1 Replies

4. Shell Programming and Scripting

Memory utilization in HP unix

Hi, I am creating monitoring scripts in HP unix for that i need CPU utilization and memory utilization in HP unix. for CPU utilization i am using TOP command for Memory utilizaion i am not able to use glance command in scripts. means i am not able to redirect and stop. apart from... (1 Reply)
Discussion started by: rsivasan
1 Replies

5. Shell Programming and Scripting

How can I obtain the consumed memory of a process?

Hi!!! how can I obtain the consumed memory of a process? nowadays i'm using ps -efo pid, pmem, comm,args .... but the information is in percentage, is that correct? so, i want to know how can obtain the consumed memory of a process in mb? thanks in advance! Richard (3 Replies)
Discussion started by: rcrutz_18
3 Replies

6. HP-UX

UNIX memory problems

I don't know if this is better suited for the application section, but here goes. We are currently running HP-UX 11 as our database server. The database is Progress version 9.1C. As of late, some of our batch processes that run on the UNIX db server are erroring out because of what appear to... (3 Replies)
Discussion started by: eddiej
3 Replies

7. UNIX for Advanced & Expert Users

unix memory management

i am looking for the books or web-sites which explains the unix memory management in detail. do you know any useful material? (1 Reply)
Discussion started by: gfhgfnhhn
1 Replies

8. UNIX for Dummies Questions & Answers

where to obtain UNIX and learning on a UNIX variant?

Hi. I've just started to get into UNIX. Researched on the Net, found out that most of the UNIX variants are not offered online. 1. Any of you guys know where I could obtain them on the Net? or anywhere at all? 2. Does learning a UNIX variant enough to cover an understanding of other UNIX... (6 Replies)
Discussion started by: ninelives1980
6 Replies

9. Programming

memory increasing on UNIX

hi, i'm writing a program that is running always... but, i have a problem that memory is increasing.. i want to know whether does stack size inscease or not, when program is running.. i don't know what is the cause stack or heap... i need some help.. :( (1 Reply)
Discussion started by: netfer
1 Replies

10. UNIX for Dummies Questions & Answers

Unix system memory

Can you please tell me how to find out System Memory (RAM) for a AIX unix server? The command prtconf will do for Solaris but I don't know for AIX Unix. (1 Reply)
Discussion started by: anilkumar
1 Replies
Login or Register to Ask a Question