tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christopher Schultz <>
Subject Re: OutOfMemory exception when deploying using manager app / catalina-ant
Date Thu, 28 Jun 2007 16:22:26 GMT
Hash: SHA1


Chris J├Âlly wrote:
> removing and deploying the war works, but after a few removals/deployments 
> the vm reports an java.lang.OutOfMemory exception and stops 
> deployment of the application. if i increase the memory size 
> of the tomcat vm then the problem appears a few deployments later.

This usually suggests that the application you are re-deploying is not
properly releasing objects and hanging around after it should be been

Often, this is caused by putting objects loaded by the webapp's
ClassLoader into something like a collection that is being retained by
the server. That causes the ClassLoader to stick around and keep all of
the java.lang.Class objects, their associated data, the JIT'd code and
everything else when it's no longer practical.

Basically, you're loading Class files until you bust your heap.

Fixing this usually requires careful analysis of what your code is doing
with long-lived objects. A memory profiler can sometimes help, but you
can easily start chasing your tail when you see /everything/ that the
runtime has laying around in memory.

I would start by checking your interactions with any libraries that you
have being loaded by the Tomcat classloaded (that is, anything in
$TOMCAT_HOME/common/lib for pre-TC6.0 or $TOMCAT_HOME/lib for TC6.0+.
You may find that Tomcat is loading some library and it has a cache of
data from your deployed webapp that is preventing disposal of that

Hope that helps,
- -chris

Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla -


To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message