tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: Re : Memory leak in Tomcat 6.0.35 ( 64 bit)
Date Thu, 04 Apr 2013 18:32:41 GMT
Hash: SHA256


On 4/3/13 4:15 PM, Howard W. Smith, Jr. wrote:
> On Tue, Apr 2, 2013 at 5:12 PM, Christopher Schultz < 
>> wrote:
>> If you don't re-deploy your webapp, then daily rolling Tomcat
>> restarts are not necessary. I wonder why you are re-deploying
>> your web application so many times?
> As a new tomcat user and still somewhat junior java/jsf developer,
> I restart tomcat whenever I have new software changes to 
> deploy-and-want-to-run-on the production server. sometimes, I 
> deploy-and-restart multiple times per day, but sometimes, I'm able
> to let tomcat/tomee run for days without restart.

That's not really conducive to high-availability. Are you using
Tomcat's parallel-deployment feature?

>> We run several Tomcats in parallel with modest heaps (less than
>> 512MiB each) and they can run for months before we stop them for
>> upgrades. It *is* possible to run JVMs without running out of
>> memory...
> I too, have not experienced any OOME, and recently, per what I
> have seen-and-read of other (more senior java developers than
> myself), I have decreased memory settings in my java options on
> tomcat7w.exe (see below).
> -Xmx1024m -XX:MaxPermSize=384m -XX:+UseTLAB 
> -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled

Your heap settings should be tailored to your environment and usage
scenarios. You can find "conventional wisdom" that recommends pretty
much any heap configuration you want. The only thing that I can
consistently recommend to anyone is to set -Xms and -Xmx to the same
value, since on a server you're pretty much guaranteed to get to -Xmx
pretty quickly, anwyay. You may as well not thrash the heap space(s)
getting there.

> My Windows 2008 R2 Server (64bit 32GB RAM) never seems to get
> higher than 1% CPU, and I think I do have memory leaks somewhere in
> the app, but FWIW (in heap dump in java visual vm), the memory
> leaks seem to be tomee leaks. In Java Visual VM, I do see the
> memory grow over time, as the app is used (without a tomcat restart
> or re-deploy of app and then restart tomcat), but I still have not
> seen OOME...'yet'.

What does your heap usage graph look like? It should be a nice
sawtooth-looking thing, like this:


You'll see that the small sawtooth pattern grows in basis over time
and then there is a major GC which will reset you back to some
baseline, then the process starts over again.

If you never get OOMEs, why do you think you have memory leaks? Or
that TomEE does?

- -chris
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools -
Comment: Using GnuPG with Thunderbird -


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message