Operating System - HP-UX
1835936 Members
1904 Online
110088 Solutions
New Discussion

Viewing contents of memory

 
SOLVED
Go to solution
William Pribble
Frequent Advisor

Viewing contents of memory

How can I veiw the contents of my system memory? I want to be able to account for all my systems memory.

thanks
9 REPLIES 9
Helen French
Honored Contributor

Re: Viewing contents of memory

Hi,

You can use HP's GlancePlus software for getting a complete memory usage/analysis.

HTH,
Shiju
Life is a promise, fulfill it!
James R. Ferguson
Acclaimed Contributor

Re: Viewing contents of memory

Hi Elaine:

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

Regards!

...JRF...

A. Clay Stephenson
Acclaimed Contributor

Re: Viewing contents of memory

The best tool for that is Glance. If you do not already have it, you can install a trial version from your Application CD's.
If it ain't broke, I can fix that.
William Pribble
Frequent Advisor

Re: Viewing contents of memory

I see using glance and I choose "m" for memory report.... is there any way to drill down to see that "process A is using this amount of memory, process is B is using this amount, the kernel is using this amount...etc" I would like to be able to veiw and account for all the structures in memory.

Thanks
James R. Ferguson
Acclaimed Contributor

Re: Viewing contents of memory

Hi Elaine:

From any screen in 'glance' you can enter "s" to select a pid. Once selected, you can see some memory stats as well as other things.

Regards!

...JRF...
William Pribble
Frequent Advisor

Re: Viewing contents of memory

Hi James,
Thanks for the additional information. Is there any way to script so I can see all pids memory usage?

Thanks again
James R. Ferguson
Acclaimed Contributor
Solution

Re: Viewing contents of memory

Hi (again) Elaine:

The easiest way to evaluate memory on a per-process basis to use this. The 'sed' strips the header returned with the output and the sort ranks the list in descending 'vsz' order. Have a look a the man pages for 'ps' for more information and the interpretaton of the fields assoicated with the '-o' flag. You can add information with other '-o' arguments.

# UNIX95= ps -e -o ruser,vsz,pid,args|sed '1d'|sort -rnk2

Note the XPG4 (UNIX95) variable is armed only for the 'ps' command line. There is a blank after the UNIX95= without any semicolon.

Regards!

...JRF...
steven Burgess_2
Honored Contributor

Re: Viewing contents of memory

and a script

let x=$(grep -i physical: /var/adm/syslog/syslog.log | head -1 | awk '{print $7}
')/1048
let z=$(vmstat|tail -1|awk '{print $5}')*4096;let z=$z/1000000
let free=100000/$x*$z
let free=$free/1000
let free=100-$free
echo "$x Mb physical memory \n$z Mb memory free \n$free % used"

Steve
take your time and think things through
Steven Sim Kok Leong
Honored Contributor

Re: Viewing contents of memory

Hi,

Memory structures include shared memory segments and semaphores.

Run the following to account for shared memory and semaphores:

For shared memory utilisation,

# ipcs -b -m

For semaphores utilisation,

# ipcs -b -s

Hope this helps. Regards.

Steven Sim Kok Leong