Operating System - HP-UX
1825781 Members
2112 Online
109687 Solutions
New Discussion

How to find total physical memory on a system

 
Saurabh Kapoor
Occasional Contributor

How to find total physical memory on a system

Can someone please help me with a command by which I can find the total physical memory on a HPUX 11 system.
10 REPLIES 10
James R. Ferguson
Acclaimed Contributor

Re: How to find total physical memory on a system

Hi:

Here are three of my favorite ways:

# dmesg

# grep -i physical grep -i physical /var/adm/syslog/OLDsyslog.log

# echo "selclass qualifier memory;info;wait;infolog"|cstm > /tmp/meminfo

Regards!

...JRF...
Rick Garland
Honored Contributor

Re: How to find total physical memory on a system

If the dmesg buffer has not filled up;
dmesg | grep -i phy

SAM will detail the info as well.
Philip Chan_1
Respected Contributor

Re: How to find total physical memory on a system

Just run SAM to get the info,

SAM -> Performance Monitor -> System Properties -> Memory

Rgds,
Philip
Patrick Wallek
Honored Contributor

Re: How to find total physical memory on a system

If you just want to see how much is installed and don't need it in a script then you can also use the print_manifest program that comes with Ignite/UX. print_manifest also gives some other good configuration information about your machine.

/opt/ignite/bin/print_manifest
federico_3
Honored Contributor

Re: How to find total physical memory on a system

Anothey method coulkd be the following :

For version 10.20:
echo "physmem/D"| adb -k /stand/vmunix /dev/kmem | tail -1 | awk '[print $2/256 }'

For versin 11.00 you should use the parameter "phys_mem_pages" in the command shown upon.


federico
Darrel Louis
Honored Contributor

Re: How to find total physical memory on a system

How can I get information about my systems configuration using the adb
command?
RESOLUTION
The adb command provides a way to gain useful information about a number of
the systems configuration areas.

To determine the physical memory (RAM) :

for HP-UX 10x
example:

echo physmem/D | adb -k /stand/vmunix /dev/kmem
physmem:
physmem: 24576

for HP-UX 11.x systems running on 32 bit architecture:
example:

echo phys_mem_pages/D | adb /stand/vmunix /dev/kmem
phys_mem_pages:
phys_mem_pages: 24576

for HP-UX 11.x systems running on 64 bit architecture:
example:

echo phys_mem_pages/D | adb64 -k /stand/vmunix /dev/mem
phys_mem_pages:
phys_mem_pages: 262144

The results of these commands are in memory pages, multiply by 4096
to obtain the size in bytes.

To determine the amount of lockable memory:
example:

echo total_lockable_mem/D | adb -k /stand/vmunix /dev/mem
total_lockable_mem:
total_lockable_mem: 185280

To determine the number of free swap pages :
example:

echo swapspc_cnt/D | adb -k /stand/vmunix /dev/kmem
swapspc_cnt:
swapspc_cnt: 216447

This will display the number of free swap pages.
Multiply the number returned by 4096 for the number of free swap bytes.

To determine the processor speed:
example:
echo itick_per_usec/D | adb -k /stand/vmunix /dev/mem
itick_per_usec:
itick_per_usec: 360

To determine the number of processors in use:
example:
echo "runningprocs/D" | adb -k /stand/vmunix /dev/mem
runningprocs:
runningprocs: 2

To determine the number of pages of buffer cache ( 4Kb in size)
example:
echo bufpages/D | adb -k /stand/vmunix /dev/mem
bufpages:
bufpages: 18848

To display kernel parameters using adb use the parameter name :
example:
echo nproc/D | adb -k /stand/vmunix /dev/mem
nproc:
nproc: 276

To determine the kernel your booted from:
example:
10.x
echo 'boot_string/S' | adb /stand/vmunix /dev/mem
boot_string:
boot_string: disc(52.6.0;0)/stand/vmunix

11.x
echo 'boot_string/S' | adb /stand/vmunix /dev/mem
boot_string:
boot_string: disk(0/0/2/0.6.0.0.0.0.0;0)/stand/vmunix

Good Luck
Jerry U
Advisor

Re: How to find total physical memory on a system

i like to use cstm

/sbin/init.d/diagnostic start

then:
cstm
sel all
info
il

and there is all kinds of useful info... although that print_manifest thing is pretty cool!
Jerry U
Advisor

Re: How to find total physical memory on a system

i like to use cstm

/sbin/init.d/diagnostic start

then:
cstm
sel all
info
il

and there is all kinds of useful info... although that print_manifest thing is pretty cool!
Joseph A Benaiah_1
Regular Advisor

Re: How to find total physical memory on a system

You can also use this short C program to display the amount of physical memory.

#include

main()
{
struct pst_static buf;
pstat(PSTAT_STATIC, &buf, sizeof(buf), 0, 0);
printf("Physical RAM = %ld MB\n", buf.physical_memory/256);
}

Cheers,

Joseph.
Wieslaw Krajewski
Honored Contributor

Re: How to find total physical memory on a system

Hi,

And another pretty simple way to display physical memory:

/usr/sam/lbin/getmem
Permanent training makes master