You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Chris Jölly <ch...@unycom.com> on 2007/06/28 18:11:31 UTC

OutOfMemory exception when deploying using manager app / catalina-ant

Hello!
 
i use ant for application building and the ant tasks defined in
catalina-ant.jar Catalina-Ant-Task for deploying the ready build 
war file to a tomcat installation. (tomcat 4.1.29)
 
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.
 
it seems that tomcat doesn't remove the webapp so that the vm can
free the memory used by this app.
 
i searched the archive and found others having this problem, but
no real solution for this problem.
 
is there a solution on this problem?
 
thx, chris

Re: OutOfMemory exception when deploying using manager app / catalina-ant

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----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