tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Endre Stølsvik <>
Subject Re: Memory leaking on [un|re]load: WebappClassLoader isn't GC'ed
Date Thu, 26 Jan 2006 09:52:33 GMT

| > It's a known problem caused by a lot of different
| > situations. It's sad
| > that a lot of important applications suffer of this
| > problem. I'm working
| > with Axis, and just trying to reload the bundled
| > webapp never release
| > the old WebappClassloader.
| > 
| > I think this is serious: hot deployment becomes
| > totally useless and you
| > have to restart tomcat each time you deploy a new
| > version :-(
| > 
| > Bye,
| > Davide Romanini
| Don't use shared libraries and you shouldn't have this
| problem.  If all of the statics are in your WEB-INF
| directory then you won't have an issue with unloading
| classes and class loaders.

That was a thought that popped into my head too at some point: it might be 
XML parsing? That it loads Tomcat's instance of xerces, and that this 
again ends up holding some reference to some piece of my data structures, 
which again holds the class, which again holds the WebappClassLoader? Or 
some stuff like that? - But I use Java 1.5?

Btw, vote for this one:

(Read what the guy _actually_ points out, and then ignore the 
Sun-engineer's evaluation, and read the reply.)

On a side note: It is annoying that JProfiler assumes that a static field 
is a "GC Root". YourKit is way better on this particular aspect, but I 
like the rest of JProfiler better!
  But it is even more annoying that the bleedin' SUN JVM and the JVMTI API 
even has a concept of "Other GC Root" - the guy that invented that JVMTI 
fieldname should have stopped for a moment and thought about "What can 
_possibly_ constitute "other" GC roots? I must be a sloppy coder, I should 
quit this job: Inventing a special type for my non-understanding of 
garbage collection is a clear sign of incompetence". And what about the 
guy that implemented the JVMTI interface in SUN's JVM: "ah lookey here, an 
"I can't bother to find the source of this root"-type root! I'll use that 
for pretty much anything that's in here, coz' I'm so fantastically lazy!".
  The problem is that most of the time, the WebappClassLoader that 
apparently is holding my entire universe and just won't let go, has "Other 
GC Root" as its GC Root. Now, THAT'S really helpful, thanks a lot!!

rather fed up with leaking java,

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

View raw message