Operating System - HP-UX
1847252 Members
3030 Online
110263 Solutions
New Discussion

ram Utilization by process wise

 
chandra Sekhar_7
Frequent Advisor

ram Utilization by process wise

Dear All,

how to find out which process is taking how much RAM utilization &processer utilization please give me a suggition.


Regards
Chandra
9 REPLIES 9
Jeeshan
Honored Contributor

Re: ram Utilization by process wise

Hi Chandra

try out this

export UNIX95=1;ps -ef -o comm,pcpu,vsz,args

This will show your processwise memory and CPU utilization.


N.B. assign points if you got the perfect result. Help to solve problems quickly.
a warrior never quits
YAQUB_1
Respected Contributor

Re: ram Utilization by process wise

Hi Chandra,

We can use top or glance command.

Thanks--Yaqub
HP Support!!!
chandra Sekhar_7
Frequent Advisor

Re: ram Utilization by process wise

Dear Yaqub,

Thanks For u r responce

Top & glance commands are never ending commands.

Regards
chandra
Dennis Handly
Acclaimed Contributor

Re: ram Utilization by process wise

>top & glance commands are never ending commands.

Are you trying to tell us something? Or is this an issue for you?

You can use "top -f file" is used, it only does the top 16. -n and -d could also be used to limit it.
chandra Sekhar_7
Frequent Advisor

Re: ram Utilization by process wise

Dear Dennis,

Thanks for u r responce,

I have to monitor high processer&ram utilization Processes By OVO For this have to write a script so we need specific command for monitoring those perameters.

Regards
chandra
Richard Price_1
Advisor

Re: ram Utilization by process wise

In my experience only gpm and extract give a realistic value for memory use. The ps value is pretty much spurious.
The extract command output can be extremely long and you'll need to use cut to sensibly get the data you're after.

This is a command I using to report back a days worth of info for a particular process:

/opt/perf/bin/extract -xp day-1 -s 00:00-23:59 -p -f stdout | grep -e Alive -e Intvl -e | cut -c1
0-32,201-208,645-715 | grep -e :00 -e Forced -e CSwtch

You'll only have gpm and extract if you've purchased hp-ux enterprise or bought them seperatley.

Regards,

Richard.
Don Morris_1
Honored Contributor

Re: ram Utilization by process wise

I'm no cpu tracking expert (sorry) -- but as always, I believe pstat exposes what you need.

Attached is a sample program that may work as-is or should be fairly easy to modify such that it will generate output for a wrapping/monitoring script. [Or just modify the program to take a time to sleep/rescan or something... your call].

Compile with +DD32 -D_PSTAT64 or +DD64 options.
Don Morris_1
Honored Contributor

Re: ram Utilization by process wise

Oh, and ps isn't that spurious if you know what you're asking for and what it is reporting (it is just calling pstat as it should).

Sepcifically, VSZ [from ps or the SIZE in top which amount to the same root] is the *virtual* size of the process. This has only bears on actual memory consumption in that it is rather hard to consume physical memory in a user process when you don't have a virtual mapping to affiliate with it. VSZ is nice to look at to get an idea of who/what is consuming Shared virtual address space (which is a scarce resource for 32-bit applications) or swap reservations (since by default virtual objects are required to be backed by swap reservations). SZ [or RES in top] is what you need to be looking at if you want to know what actual memory is being consumed.

Yes, SZ/RES isn't perfect -- there's some heuristic games played to try to share the "cost" of shared objects across all the attached processes so anyone summing across all processes won't wonder how that 32Gb database is suddenly present everywhere and their processes are 50x the actual RAM in the box. But if you're trying to monitor a process or see where the consumption lies per process or process group, that's going to get you in the right direction and is often sufficient.

Glance is always better and nice -- but ps isn't useless if you use it properly.
Tim Nelson
Honored Contributor

Re: ram Utilization by process wise

A great tool for memory usage is kmeminfo.

search the forums it is here.

tool: kmeminfo 5.19
unix: /stand/vmunix 11.23 64bit IA64 on "ux02h"
core: /dev/kmem live
link: Thu Aug 09 16:18:34 CDT 2007
boot: Wed Mar 5 16:23:33 2008
time: Fri Mar 28 10:56:08 2008
nbpg: 4096 bytes


----------------------------------------------------------------------
Physical memory usage summary (in page/byte/percent):

Physical memory = 1046400 4.0g 100%
Free memory = 431179 1.6g 41%
User processes = 284063 1.1g 27% details with -user
System = 183867 718.2m 18%
Kernel = 162939 636.5m 16% kernel text and data
Dynamic Arenas = 73092 285.5m 7% details with -arena
vx_global_kmcac = 24596 96.1m 2%
spinlock = 11841 46.3m 1%
VFD_BT_NODE = 7272 28.4m 1%
vm_pfn2v_arena = 4148 16.2m 0%
M_TEMP = 3411 13.3m 0%
Other arenas = 21824 85.2m 2% details with -arena
Super page pool = 16688 65.2m 2% details with -kas
Static Tables = 49564 193.6m 5% details with -static
pfdat = 24525 95.8m 2%
vhpt = 8192 32.0m 1%
text = 7207 28.2m 1% vmunix text section
nbuf = 2112 8.2m 0% bufcache headers
bufhash = 2048 8.0m 0% bufcache hash headers
Other tables = 5479 21.4m 1% details with -static
Buffer cache = 20928 81.8m 2% details with -bufcache
ux02h@root:/usr/contrib/bin #