1834361 Members
2481 Online
110066 Solutions
New Discussion

memory usage report

 
SOLVED
Go to solution
GK_5
Regular Advisor

memory usage report

I want to see the memory usage on HPUX.
Is there any command other than vmstat?

Thanks
IT is great!
4 REPLIES 4
James R. Ferguson
Acclaimed Contributor

Re: memory usage report

Hi:

'glance' is probably your best tool. If you don't have a licensed version (and you should!), install a trail version from the Application CDROM set.

Regards!

...JRF...
Massimo Bianchi
Honored Contributor
Solution

Re: memory usage report

Hi,
if you paid for it, there is glance (or gpm, graphical version).

Other free commands include:

ipcs
top
sar -b

ps used with the UNIX95 variant:
UNIX95= ps -e -o ruser,vsz,pid,args |sort -rnk2

it depends on your needs.

HTH,
Massimo
Caesar_3
Esteemed Contributor

Re: memory usage report

Hello!

You can use glance, it free for 60 days.
Also top show the info.

Caesar
Hasell Blad
Advisor

Re: memory usage report

Hi...

Refer to the following.
compile and run it.

#include
#include
#include

main()
{
struct pst_static pst1;
struct pst_dynamic pst2;

if (pstat_getstatic(&pst1, sizeof(pst1), (size_t)1, 0) != -1)
printf( "Physical Memory is %ld MB\n", pst1.physical_memory * 4 / 1024 );
else
perror("pstat_getstatic");

if (pstat_getdynamic(&pst2, sizeof(pst2), (size_t)1, 0) != -1)
{
printf( "used Memory is %ld MB\n", (pst1.physical_memory - pst2.psd_free) * 4 / 1024 );
printf( "free Memory is %ld MB\n", pst2.psd_free * 4 / 1024 );
}
else
perror("pstat_getdynamic");

printf( "\n" );
printf( "physical Memory is %ld MB\n", pst1.physical_memory * 4 / 1024 );
printf( "used Memory is %ld MB\n", (pst1.physical_memory - pst2.psd_free) * 4 / 1024 );
printf( "memory usage is %3.1f %%\n", (float)((pst1.physical_memory - pst2.psd_free) * 100) / (float)pst1.physical_memory );
}
Hudson