tomcat-users mailing list archives

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

Chris,

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
destroyed.

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
ClassLoader.

Hope that helps,
- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGg+BC9CaO5/Lv0PARApYgAKCNwaOCP1P1vMSJzb0mssQtXeehXwCfe42p
lOvHhk4U/3rc9VyJ80Yv6Mc=
=0Osi
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message