Operating System - HP-UX
1826446 Members
4108 Online
109692 Solutions
New Discussion

how to obtain Physical memory ?

 
SOLVED
Go to solution
mobidyc
Trusted Contributor

how to obtain Physical memory ?

Hello,

on a B.11.23 i can't obtain physical memory info:

#> dmesg |grep Physical
#> echo "phys_mem_pages/D" | adb64 /stand/vmunix /dev/kmem
phys_mem_pages:
phys_mem_pages: 0
#> echo "phys_mem_pages/D" | adb64 /stand/vmunix /dev/mem
adb: warning: Trouble reading version string from memory file ...
adb: warning: Object file and memory file may not be matched.
adb: error: /dev/mem: Device busy.
adb: warning: Could not complete object file specific initializtions ...
adb: warning: Proceeding anyway; But some commands may fail.
phys_mem_pages:
phys_mem_pages:
adb: error: /dev/mem: Device busy.

i have rmsf and insf /dev/[k]mem with the same result.

i know i can obtain this information with glance but i search a way for script.

thanks for help.
Best regards, Cedrick Gaillard
4 REPLIES 4
Peter Godron
Honored Contributor
Solution

Re: how to obtain Physical memory ?

Hi,
try:

perl -e 'local($PSTAT,$PSTAT_STATIC,$mem_info,$PSTAT_STRUCT)=(239,2,"\0"x120,"LI4L");
syscall($PSTAT,$PSTAT_STATIC,$mem_info,length($mem_info),1,0);
print "RAM=".int((unpack($PSTAT_STRUCT,$mem_info))[4]*((unpack($PSTAT_STRUCT,$mem_info))[5])/(1024*1024))."\n";'
Yarek
Regular Advisor

Re: how to obtain Physical memory ?

hi,

other options:

1) sam -> performance monitor -> system properties -> memory

2) echo "selclass qualifier memory;info;wait;infolog"|cstm



rgds.

mobidyc
Trusted Contributor

Re: how to obtain Physical memory ?

Big thanks Peter for your perl script, i can use it directly in a script ;)

thanks Yarek for your cstm echo, i had forgotten it.

Cheers,
Cédrick Gaillard
Best regards, Cedrick Gaillard
mobidyc
Trusted Contributor

Re: how to obtain Physical memory ?

Big thanks Peter for your perl script, i can use it directly in a script ;)

thanks Yarek for your cstm echo, i had forgotten it.

Cheers,
Cedrick Gaillard
Best regards, Cedrick Gaillard