1833528 Members
2850 Online
110061 Solutions
New Discussion

Re: Memory usage

 
Shakeer_1
Occasional Advisor

Memory usage

Dear all,

Is there anyway to find out the consolidated used/free physical memory (RAM) apart from top. if top is the only solution plz explain the memory part of top.

Thanks in advance
Shakeer
6 REPLIES 6
A. Clay Stephenson
Acclaimed Contributor

Re: Memory usage

Top is a meaningless tool for this. Top only knows about memory directly related to processes. It knows nothing about kernel data structures such as buffer cache. On HP-UX boxes, the best tool for the job is Glance. Glance must be purchased although a 60-day trial version can be found on any Applications CD Set. It is the performance measurement tool of choice for HP-UX.
If it ain't broke, I can fix that.
Pete Randall
Outstanding Contributor

Re: Memory usage

Top is probably the worst way to find this information. The best way is to run Glance. Lacking glance you can look at swapinfo.


Pete

Pete
Devender Khatana
Honored Contributor

Re: Memory usage

Hi,

Just try "swapinfo -atm" if you do not have Glance.Also you can check some virtual memory activity through vmstat. See man vmstat for details.

HTH,
Devender
Impossible itself mentions "I m possible"
Bill Hassell
Honored Contributor

Re: Memory usage

Unix tools are very poor at showing memory usage. It isn't a simple process+kernel answer. Memory is used by the buffer cache, by shared libraries and shared memory segments, by memory mapped files, I/O buffers, etc. If what you really want to know is how much RAM is used by each process, this will show memory usage (just the resident set size (core image) but will not show swapped areas or shared areas:

UNIX95=1 ps -e -o vsz,uid,pid,ppid,args | sort -rn

The first column is RAM in Kbytes, next is user, PID, and parent PID plus the command line. To break out all the other memory areas, you need Glance. There is a trial version on your Application CDROM set.

Note: if you're getting an "out of memory" error, it is very likely not due to RAM usage but due to restrictions on what the program is allowed to request for memory.


Bill Hassell, sysadmin
Geoff Wild
Honored Contributor

Re: Memory usage

Here's a c program that does a pretty good job - output like:

# memdetail
Memory Stat total used avail %used
physical 10080.0 10032.9 47.1 100%
active virtual 12017.9 5899.8 6118.1 49%
active real 8177.2 3867.3 4309.9 47%
memory swap 7693.0 1448.6 6244.3 19%
device swap 26528.0 11021.1 15506.9 42%

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
HGN
Honored Contributor

Re: Memory usage

Hi

You could use Glance ,glance gives a lot of details in a nice way.
#swapinfo -mat would give you the swap details.

Rgds

HGN