tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Endre StĂžlsvik <En...@Stolsvik.com>
Subject RE: Memory Settings On Tomcat
Date Thu, 17 Jun 2004 15:26:56 GMT
On Wed, 16 Jun 2004, Shapira, Yoav wrote:

|
| Hola ;)
|
| >Okay? Expected? I don't get that. Can you point me to a email-subject
| of
| >one of those threads? Or several?!
|
| There are a number of issues in this space.  For example, if your
| servlet class keep a static reference, that can't be garbage collected
| when the webapp is recycled.
| Therefore the old class definition itself can't be discarded and must be
| kept along with its classloader in the JVM.  A new classloader is
| created and loads new copies of your webapp classes, resulting in a
| total memory increase.
|

Why not? I don't think this is correct. See, if the class isn't referenced
anymore, by not having any referenced objects of that class (by any
reference), nor having the class object referenced, on the stack of any of
the JVM's created Threads, then the static fields of that class isn't
referenced either, and thus both will be gc'ed, and then the classloader
will be gc'ed..

| Eventually, we made a note of this in the release notes: see the section
| titled "Web application reloading and static fields in shared
| libraries".

This concerns something else, but is a very good point. I didn't actually
know that any -shared- standard Java library will put references to my
objects in its internal structures. Know of any specific examples of this?

|
| That's one example.  There are other more insidious cases.  If you
| search the list archives (or even google) for things like "tomcat webapp
| reload memory leak" or "tomcat reload OutOfMemoryError" you'll see the
| threads and discussions, e.g.
| http://www.junlu.com/msg/38828.html and
| http://www.junlu.com/msg/13981.html.

I will do this - and thanks a LOT for your time and information so far!

Endre.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message