1833662 Members
3539 Online
110062 Solutions
New Discussion

Re: glance

 
SOLVED
Go to solution
Ragni Singh
Super Advisor

glance

Hey guys, is it possible to create a monitor througg glance that will show only if there is a memory leak. Any thought or help will be greatly appreciated.
6 REPLIES 6
James R. Ferguson
Acclaimed Contributor

Re: glance

Hi:

You could monitor the "growth" with:

# UNIX95= ps -e -o "user,vsz,pid,ppid,args" | awk 'NR>1' | sort -rnk2

Note the blank (space) character after the equal sign and before the 'ps' command.

Regards!

...JRF...
PIYUSH D. PATEL
Honored Contributor

Re: glance

Hi,

UNIX95= ps -eo vsz,ruser,pid,args | sort -rn | more

This sorts all programs in descending amount of RAM. Just repeat regularly and see what grows.

Piyush
S.K. Chan
Honored Contributor
Solution

Re: glance

JRF's method is the best way to do it without having to use glance. I would go for that, but if you want to know how you can get the same info in glance ...
# glance -R
==> That brings you to "Process Resources"
==> Enter the PID of the process you want to monitor at the bottom of the screen and hit RETURN.
==> Take a look at "Total RSS/VSS"
==> This value shows the virtual stack size for this process (the requested memory for this process). If it increases more and more over time it could mean there is a memory leak.

Ragni Singh
Super Advisor

Re: glance

But guys, isn't there a way I can put this in the parm file for glance and so al they would see is the memory information. Any ideas or suggestions.
S.K. Chan
Honored Contributor

Re: glance

It sounds like you are looking at running glance in adviser mode ? Take a look if you have this adviser-syntax file for memory leak.

/opt/perf/examples/adviser/proc_mem_leak

The chance is it should exist. If it does, all you need to do is run it like so .. (capture the output every 5 minutes)

# cd /opt/perf/examples/adviser
# glance -adviser_only -syntax proc_mem_leak -j300 | tee /tmp/memleak.output

I personally have not try this before.

Mladen Despic
Honored Contributor

Re: glance

Sanman,

My suggestions in the order of importance are as follows:

1. Monitor global metrics, such as GBL_MEM_UTIL from your Measureware logs (via PerfView or 'extract"). If you notice a gradual increase over time, you can then drill down to application and process metrics (see below). You can also set Measureware alarms by editing /var/opt/perf/alarmdef. (Remember to run 'mwa restart alarm'). For further details, see /opt/perf/paperdocs/mwa/C/mwausers.pdf. A couple of examples on 'alarmdef' are given under /opt/perf/examples/mwaconfig/

2. If you are interested in a particular process, or a group of processes, you can define "applications" in your parm file. See /opt/perf/examples/mwaconfig/parm_apps for some examples.
(Remember to run 'mwa restart scope')

You can then view the collected application metrics, including memory utilization, via PerfView or 'extract'.
You can also use Measureware application metrics in your alarmdef.

NOTE: Measureware will collect application metrics in each interval, but the process metrics are collected only for "interesting processes" in any given interval.
So, unless you "wrap" your process in an application, you may not be able to get what you want out of Measureware logs.

3. If you want to use Glance to monitor memory utilization at a process level, the parm file won't help (the parm file is used for configuring Measureware collection process only). However, you can run Glance in "adviser only" mode to log "anything you want". For example, try this:

glance -adviser_only -syntax /opt/perf/examples/proc_mem_leak -j 60

NOTE: The file /opt/perf/examples/proc_mem_leak should exist on your system if you have a recent version of Glance.

For more information on "adviser syntax" check this document:
/opt/perf/paperdocs/gp/C/adviser.pdf

Do 'man glance' to check other command line options.

NOTE: If you want to go a step further, you can also integrate your "glance adviser_only output" with your Measureware logs. See /opt/perf/paperdocs/mwa/C/mwadsi.pdf

HTH,

Mladen