You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Guenter Knauf <fu...@apache.org> on 2008/04/11 14:17:40 UTC

Question about Tomcat memory leaks

Hi all,
I've a prob with a Tomcat application.
This is an app which was bought by a customer which I work for.
The app runs on a plain WinXP box with nothing else installed on it but only the Tomcat servive + MySQL server. The app is used through the standalone http connector; Tomcat version is 5.5.25.
Now since few days the box tends to crash with all memory exhausted...
I cant tell at the moment if any component of the involved software packages was updated recently.
Now my question is: can someone give me some hints how I can observe the memory consumption of Tomcat to see if there might be a leak either in Tomcat self (saw some BZ, and ChangeLog entries that something was fixed with 5.5.26), or also with their app?

thanks in advance for any suggestions!

greets, Guen.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


RE: Question about Tomcat memory leaks

Posted by Guenter Knauf <fu...@apache.org>.
Hi all,
> But since you describe "server" memory exhaustion, you should use Windows
> perfmon tool to log process memory (see  HOW TO: Create and Configure
> Performance Monitor Trace Logs, http://support.microsoft.com/?kbid=302552
hmm, this link give's me a 'currently not available'.
> ) and determine which process is leaking.  If this is tomcat, then start
> by reducing -Xmx option to a level that the server can handle (and not
> crash).
> And finally, use the very good suggestions of others to use a java memory
> profiler.
yes, a big thanks to all for your suggestions, that helped a lot already.
Unfortunately at current state I want to do as less as possible on the config + app itself;
so for now I've hacked a WSH script which does fetch some perfmon memory values and mails the results to me so that I monitor the rate on which the memory goes low, and act before the WinXP box freezes up.

If I can nail down what leaks within the next days, then next step will be a test installation on another box where I can check details with YourKit; I found that currently a 7.1 EAP version is available without need for a licence, and I hope this might be good enough to show up where the main probs are - it is enough for me to proof that it is their app (which I assume); however few other things might be possible as well: mysqld or the mysql jdbc driver (which I doubt).
I think its most likely that they dont free all mysql result resources....

thanks all again, Guenter.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Question about Tomcat memory leaks

Posted by Mark Thomas <ma...@apache.org>.
Guenter Knauf wrote:
> Hi all,
> I've a prob with a Tomcat application.
> This is an app which was bought by a customer which I work for.
> The app runs on a plain WinXP box with nothing else installed on it but only the Tomcat servive + MySQL server. The app is used through the standalone http connector; Tomcat version is 5.5.25.
> Now since few days the box tends to crash with all memory exhausted...
> I cant tell at the moment if any component of the involved software packages was updated recently.
> Now my question is: can someone give me some hints how I can observe the memory consumption of Tomcat to see if there might be a leak either in Tomcat self (saw some BZ, and ChangeLog entries that something was fixed with 5.5.26), or also with their app?
> 
> thanks in advance for any suggestions!

Use a profiler. My personal favourite is YourKit but there are plenty of 
others.

The only memory leaks we tend to see in Tomcat, and they are getting rarer, 
are related to reloading. If you are not reloading the webapp it is almost 
certainly an app problem rather than a Tomcat one. Either way, the only way 
to be sure is to use a profiler.

Mark


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Question about Tomcat memory leaks

Posted by Costin Manolache <co...@gmail.com>.
Well, if the _server machine_ is running out of memory - I think
Yourkit/Jprofiler or most java options won't help.
Just make sure you do have the -Xmx option in tomcat - and it's
reasonable ( less than 1/2 of total RAM I would guess ).

Java is very good at using -Xmx for the heap - I never seen it use
more for the heap. You use Jprofiler if you see OutOfMemoryException
or a lot of garbage collection.

The non-heap in java is a different story - like any native code it's
hard to predict or limit. I didn't see leaks (unless a bad JNI library
is used ), but I never found any way to predict how much is needed to
avoid swap ( typically the goal is to use all the memory in the server
you can - but to never swap).
Use the OS tools for that - I have no clue about XP, unix is simple (
top, etc ).

Costin

On Fri, Apr 11, 2008 at 5:30 AM, Henri Gomez <he...@gmail.com> wrote:
> you could activate jmxremove to track it in real time via JConsole :
>
>  Add these to JAVA_OPTS :
>
>  -Dcom.sun.management.jmxremote.port=8090
>  -Dcom.sun.management.jmxremote=true
>  -Dcom.sun.management.jmxremote.authenticate=false
>  -Dcom.sun.management.jmxremote.ssl=false -Djava.awt.headless=true
>
>  Also commercial products like Jprofiler are definitive good candidates
>  to track memory licks
>
>  Regards
>
>  2008/4/11, Guenter Knauf <fu...@apache.org>:
>
>
> > Hi all,
>  >  I've a prob with a Tomcat application.
>  >  This is an app which was bought by a customer which I work for.
>  >  The app runs on a plain WinXP box with nothing else installed on it but only the Tomcat servive + MySQL server. The app is used through the standalone http connector; Tomcat version is 5.5.25.
>  >  Now since few days the box tends to crash with all memory exhausted...
>  >  I cant tell at the moment if any component of the involved software packages was updated recently.
>  >  Now my question is: can someone give me some hints how I can observe the memory consumption of Tomcat to see if there might be a leak either in Tomcat self (saw some BZ, and ChangeLog entries that something was fixed with 5.5.26), or also with their app?
>  >
>  >  thanks in advance for any suggestions!
>  >
>  >  greets, Guen.
>  >
>  >
>  >
>  >  ---------------------------------------------------------------------
>  >  To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>  >  For additional commands, e-mail: dev-help@tomcat.apache.org
>  >
>  >
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>  For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Question about Tomcat memory leaks

Posted by Henri Gomez <he...@gmail.com>.
Yourkit is free for 15 days :)

2008/4/11, Henri Gomez <he...@gmail.com>:
> you could activate jmxremove to track it in real time via JConsole :
>
>  Add these to JAVA_OPTS :
>
>  -Dcom.sun.management.jmxremote.port=8090
>  -Dcom.sun.management.jmxremote=true
>  -Dcom.sun.management.jmxremote.authenticate=false
>  -Dcom.sun.management.jmxremote.ssl=false -Djava.awt.headless=true
>
>  Also commercial products like Jprofiler are definitive good candidates
>  to track memory licks
>
>  Regards
>
>  2008/4/11, Guenter Knauf <fu...@apache.org>:
>
> > Hi all,
>  >  I've a prob with a Tomcat application.
>  >  This is an app which was bought by a customer which I work for.
>  >  The app runs on a plain WinXP box with nothing else installed on it but only the Tomcat servive + MySQL server. The app is used through the standalone http connector; Tomcat version is 5.5.25.
>  >  Now since few days the box tends to crash with all memory exhausted...
>  >  I cant tell at the moment if any component of the involved software packages was updated recently.
>  >  Now my question is: can someone give me some hints how I can observe the memory consumption of Tomcat to see if there might be a leak either in Tomcat self (saw some BZ, and ChangeLog entries that something was fixed with 5.5.26), or also with their app?
>  >
>  >  thanks in advance for any suggestions!
>  >
>  >  greets, Guen.
>  >
>  >
>  >
>  >  ---------------------------------------------------------------------
>  >  To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>  >  For additional commands, e-mail: dev-help@tomcat.apache.org
>  >
>  >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Re: Question about Tomcat memory leaks

Posted by Henri Gomez <he...@gmail.com>.
you could activate jmxremove to track it in real time via JConsole :

Add these to JAVA_OPTS :

-Dcom.sun.management.jmxremote.port=8090
-Dcom.sun.management.jmxremote=true
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false -Djava.awt.headless=true

Also commercial products like Jprofiler are definitive good candidates
to track memory licks

Regards

2008/4/11, Guenter Knauf <fu...@apache.org>:
> Hi all,
>  I've a prob with a Tomcat application.
>  This is an app which was bought by a customer which I work for.
>  The app runs on a plain WinXP box with nothing else installed on it but only the Tomcat servive + MySQL server. The app is used through the standalone http connector; Tomcat version is 5.5.25.
>  Now since few days the box tends to crash with all memory exhausted...
>  I cant tell at the moment if any component of the involved software packages was updated recently.
>  Now my question is: can someone give me some hints how I can observe the memory consumption of Tomcat to see if there might be a leak either in Tomcat self (saw some BZ, and ChangeLog entries that something was fixed with 5.5.26), or also with their app?
>
>  thanks in advance for any suggestions!
>
>  greets, Guen.
>
>
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
>  For additional commands, e-mail: dev-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


RE: Question about Tomcat memory leaks

Posted by Christophe Pierret <cp...@sparus-software.com>.
Hi Guenter,
You could have a look at:
http://wiki.apache.org/tomcat/FAQ/Memory
But since you describe "server" memory exhaustion, you should use Windows perfmon tool to log process memory (see  HOW TO: Create and Configure Performance Monitor Trace Logs, http://support.microsoft.com/?kbid=302552 ) and determine which process is leaking.  If this is tomcat, then start by reducing -Xmx option to a level that the server can handle (and not crash).
And finally, use the very good suggestions of others to use a java memory profiler.

Regards,
Christophe

-----Message d'origine-----
De : Guenter Knauf [mailto:fuankg@apache.org] 
Envoyé : vendredi 11 avril 2008 14:18
À : dev@tomcat.apache.org
Objet : Question about Tomcat memory leaks

Hi all,
I've a prob with a Tomcat application.
This is an app which was bought by a customer which I work for.
The app runs on a plain WinXP box with nothing else installed on it but only the Tomcat servive + MySQL server. The app is used through the standalone http connector; Tomcat version is 5.5.25.
Now since few days the box tends to crash with all memory exhausted...
I cant tell at the moment if any component of the involved software packages was updated recently.
Now my question is: can someone give me some hints how I can observe the memory consumption of Tomcat to see if there might be a leak either in Tomcat self (saw some BZ, and ChangeLog entries that something was fixed with 5.5.26), or also with their app?

thanks in advance for any suggestions!

greets, Guen.



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org