1838243 Members
6046 Online
110125 Solutions
New Discussion

memory leakage

 
SOLVED
Go to solution
Shivkumar
Super Advisor

memory leakage

Sir,

We are using hp apache, weblogic and iplanet web server on hpux 11i.

I suspect some of them might be producing memory leakage.

Can someone suggest how to find out memory leakage ?

Thanks,
Shiv
4 REPLIES 4
Mel Burslan
Honored Contributor
Solution

Re: memory leakage

The combination of products you listed did not make much sense to me as most people run either apache or (pay for and run) iplanet or with its new name sun one server but anyways, here is a couple of commands that you can run to find offending programs:

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

or just to monitor httpd (for apache as an example)

UNIX95= ps -C httpd -o vsz,pid,ruser,args

above are from my notes that I took from some previous itrc posts regarding memory leak issue.

also check ipcs command usage on the man page. You can find few command line switches like -m or -b to monitor the memory usage.

running these commands from cron hourly or more frequently if you can afford, and logging the output to a file for a few days time, may show you if something is sticking out.

memory leaks are caused by sloppy programmers whose code does not release the memory they grabbed after the exit. Find the offending process and talk to the application developer.
________________________________
UNIX because I majored in cryptology...
Steve Steel
Honored Contributor

Re: memory leakage

Hi


All the tools you need at

ftp://eh:spear9@hprc.external.hp.com/memory.htm


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

Re: memory leakage

For detecting memory leak, you have to buy commertial tool like purify and insure++.

gdb (wdb) in some versions are supporting possibility to detect memory leak. We can use info leaks command on gdb to detect this.

A small document written to get memory leak in small c program is given here as,

http://geocities.com/kmuthu_gct/memoryleak_gdb.html

hth.

Easy to suggest when don't know about the problem!
Ralph Grothe
Honored Contributor

Re: memory leakage

I can't comment on iPlanat (aka SUN ONE) Webserver since we don't run this product.
That you run all the named webservers on a single machine would only make sense to me if that was a development workplace or similar.
We do however run a BEA Weblogic server (which I think is entirely Java J2EE).
Afaik, the Java VM is running its own garbage collector that should (theoretically) free unrefernced memory segments, and thus avoid memory leakages.
However, I've also heard from the developers who set up our Weblogic application that a knowledgeable Java hacker can circumvent the Java garbage collector and initate collection time slices at random.
I can't recall what the technique was called.
But this in mind also shows potential for memory leaks with Weblogic apps to me.

Yet another story is Apache if your webdevelopers make use of modules like mod_perl.
An inconsiderate coder who isn't initializing and freeing resources (data structure, objects etc.) as recommended by the mod_perl guidelines, might very well produce memory leaks, or even worse, severely impair the operation of Apache.

SUN being the inventors of Java I would guess that iPlanet is also a purely Java technology.
So I could imagine that the same is thinkable as what I have said regarding Weblogic.
Madness, thy name is system administration