Operating System - HP-UX
1833017 Members
2230 Online
110048 Solutions
New Discussion

Determine available memory using Hp-UX 11.11 via comand line

 
SOLVED
Go to solution
Brian_349
New Member

Determine available memory using Hp-UX 11.11 via comand line

I am looking for method to determine the available memory on a system running HP-UX 11.11. Ideally I would like to find a way to capture the same value being reported by glance: Memory Report - Free Memory

I have tried using pstat.h but this does not seem to be functioning properly (using HP-UX 11.11, 11.00 works fine). Specifily I am querying dbuf.psd_free sbuf.page_size.
8 REPLIES 8
RAC_1
Honored Contributor
Solution

Re: Determine available memory using Hp-UX 11.11 via comand line

echo "free_memory/D" | adb -k /stand/vmunix /dev/kmem

The value is in pages.

vmstat 4 4

The value is in pages. (1buf page = 4096k)

Anil
There is no substitute to HARDWORK
Carsten Krege
Honored Contributor

Re: Determine available memory using Hp-UX 11.11 via comand line

use the following command:

echo freemem/D | adb /stand/vmunix /dev/kmem

This gives the free memory in pages (1 page 4kB) . This means you need to multiply with 4/1024 to get the value in MB.

To get exactly the glance value (more complicated and not better) you can run glance in advisor mode:

# glance -iterations 1 -adviser_only -syntax advisor.mem

with advisor.mem containing the line

PRINT GBL_MEM_FREE

Carsten


-------------------------------------------------------------------------------------------------
In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move. -- HhGttG
rvrameshbabu
Advisor

Re: Determine available memory using Hp-UX 11.11 via comand line

# REAL_MEM=$(echo 'phys_mem_pages/D'| adb -k /stand/vmunix /dev/kmem | tail -1 | awk '{print $2}')
# echo $REAL_MEM
262144
# MemorySize=$(expr ${REAL_MEM} / 256)
# echo $MemorySize
1024
#
RAC_1
Honored Contributor

Re: Determine available memory using Hp-UX 11.11 via comand line

I missed it.
The correct command is

echo freemem/D|adb -k /stand/vmunix /dev/kmem

thank you - Carsten

Anil
There is no substitute to HARDWORK
Brian_349
New Member

Re: Determine available memory using Hp-UX 11.11 via comand line

Thanks for all of the help! My problem has been resolved!
Brian_349
New Member

Re: Determine available memory using Hp-UX 11.11 via comand line

one last thing...

The adb tool is new to me, can you point me to a good online refrence? I wol like to know what else I can parse from adb
Muthukumar_5
Honored Contributor

Re: Determine available memory using Hp-UX 11.11 via comand line

You can get physical memory informations and it's available using dmesg as,

dmesg | grep -e Memory -e bytes

You can use nm to get all the associated symbols needed to be known as like freemem as,

nm /stand/vmunix | grep freemem

You can use man page adb to start with.

Easy to suggest when don't know about the problem!