Operating System - HP-UX
1831477 Members
3416 Online
110025 Solutions
New Discussion

top: memory output confusing

 
henrik bartels_1
Occasional Contributor

top: memory output confusing

Hello !

I have spent almost a day trying to find a document or manual that describes the memory output of top command on HP-UX...but I didn't succeed:

The top output:
==============
Memory: 2475676K (905868K) real, 4651812K (2893064K) virtual, 1579284K free Page# 1/20

dmesg output:
=============
Physical: 5767168 Kbytes, lockable: 4272304 Kbytes, available: 4914408 Kbytes

....I thought real mem was the same as physical but in this case it seams to be the same as virtual memory and what is number in paranthes ?
5 REPLIES 5
Todd McDaniel_1
Honored Contributor

Re: top: memory output confusing

From what I have seen is that top has a decieving report of memory.

The best way is to look at the kernel or use glance or even swapinfo will show it.

here is a good script that offers the actual memory on your system.


------------------------cut here-----------------------

# cat hpmem
#!/bin/ksh
#
# Taken from the HP/UniGraphics FAQ
# You must be ROOT to execute this since it uses adb to
# examine the running kernel
#
GetKernelSymbol()
{
echo "$1/D" | \
adb -k $hpux /dev/kmem | \
tr "\012" " " | \
read junk junk2 kval
}
hpux=/hp-ux
rev=$(uname -r | cut -d. -f2)
if ((rev > 9)); then hpux=/stand/vmunix ;fi
/bin/uname -a
GetKernelSymbol "processor_count"
print CPU Count: $kval
GetKernelSymbol "itick_per_tick"
let speed=kval/10000
print CPU Speed: $speed MHz
if ((rev > 10)); then
print CPU HW Support: `getconf HW_CPU_SUPP_BITS`-bit
print Kernel Support: `getconf KERNEL_BITS`-bit
GetKernelSymbol "memory_installed_in_machine"
else
GetKernelSymbol "physmem"
fi
let mb=kval*4/1024 # convert pages to MB
print RAM Size: $mb MB
GetKernelSymbol "bufpages"
let mb=kval*4/1024 # convert pages to MB
print bufpages: $mb MB
GetKernelSymbol "maxuprc"
print maxuprc: $kval
GetKernelSymbol "maxvgs"
print maxvgs: $kval
GetKernelSymbol "maxfiles"
print maxfiles: $kval
GetKernelSymbol "max_thread_proc"
print max_thread_proc: $kval
GetKernelSymbol "nfile"
print nfile: $kval
GetKernelSymbol "nflocks"
print nflock: $kval
GetKernelSymbol "nproc"
print nproc: $kval
GetKernelSymbol "ninode"
print ninode: $kval
GetKernelSymbol "vfd_cw"
print shmmax: $kval
GetKernelSymbol "shmmni"
print shmmni: $kval
GetKernelSymbol "dbc_max_pct"
print dbc_max_pct: $kval
Unix, the other white meat.
Helen French
Honored Contributor

Re: top: memory output confusing

Actually the memory information from top and dmesg are totally different. dmesg is showing the physical memory information that was picked up from the log files (boot time), where as top is showing the process-memory information.

The values in brackets are memory in "active". Read these threads too:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=44849

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=207806
Life is a promise, fulfill it!
Steven E. Protter
Exalted Contributor

Re: top: memory output confusing

There are different calcultion methods for different utilities. You can use the script in the prior post, you can use other utilities.

I personally like swapinfo -tam it gives a good memory picture but might further confuse you because the results may not correlate with top.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Steve Steel
Honored Contributor

Re: top: memory output confusing

Hi

see the man page

HP-UX Reference Volume 1 of 5

Section 1: Commands
T
timex(1)
touch(1)




top(1) Description
Examples
Author



NAME
top - display and update information about the top processes on the system
SYNOPSIS

top [-s time] [-d count] [-q] [-u] [-h] [-n number]



--------------------------------------------------------------------------------
DESCRIPTION

top displays the top processes on the system and periodically updates the information. Raw CPU percentage is used to rank the processes.
Options

top recognizes the following command-line options: -s time Set the delay between screen updates to time seconds. The default delay between updates is 5 seconds.
-d count Show only count displays, then exit. A display is considered to be one update of the screen. This option is used to select the number of displays to be shown before the program exits.
-q This option runs the top program at the same priority as if it is executed via a nice -20 command so that it will execute faster (see nice(1) ). This can be very useful in discovering any system problem when the system is very sluggish. This option is accessibly only to users who have appropriate privileges.
-u User ID (uid) numbers are displayed instead of usernames. This improves execution speed by eliminating the additional time required to map uid numbers to user names.
-h Hides the individual CPU state information for systems having multiple processors. Only the average CPU status will be displayed.
-n number Show only number processes per screen. Note that this option is ignored if number is greater than the maximum number of processes that can be displayed per screen.


Screen-Control Commands

When displaying multiple-screen data, top recognizes the following keyboard screen-control commands: j Display next screen if the current screen is not the last screen.
k Display previous screen if the current screen is not the first screen.
t Display the first (top) screen.


Program Termination

To exit the program and resume normal user activities, type q at any time.

Display Description

Three general classes of information are displayed by top: System Data:
The first few lines at the top of the display show general information about the state of the system, including:
System name and current time.


Load averages in the last one, five, and fifteen minutes.


Number of existing processes and the number of processes in each state (sleeping, waiting, running, starting, zombie, and stopped).


Percentage of time spent in each of the processor states (user, nice, system, idle, interrupt and swapper) per processor on the system.


Average value for each of the processor states (only on multi-processor systems).

Memory Data Includes virtual and real memory in use (with the amount of memory considered "active" in parentheses) and the amount of free memory.


*************************************


Top is a poor estimate get Glance to see it properly


Steve Steel
If you want truly to understand something, try to change it. (Kurt Lewin)
Todd McDaniel_1
Honored Contributor

Re: top: memory output confusing

Forgot, also vmstat will show active memory use...

vmstat 5 4 will give you an interval to look at to show realtime memory.
Unix, the other white meat.