> From: Narayanaswamy, Mohan 
> [mailto:[EMAIL PROTECTED] 
> Subject: RE: Tomcat PermGen OutOfMemoryException solution?
> 
> Do you mean that tomcat(or Java) will have multiple copies
> of the same class, assuming same jar shipped with different
> applications, Can't tomcat class loader identify & avoid them?

No, there's no guarantee they're identical, even when they have the same
name.  There isn't one Tomcat class loader, there are several, including
one per deployed webapp.  When a webapp is undeployed, the associated
classloader and therefore the webapp classes should be reclaimable by
garbage collection.  Unfortunately, things like badly implemented shared
libraries often prevent that from happening.

> If there is a web hosting company, multiple application
> may use the same jar (say struts1.x.jar) - so does JVM
> keep multiple copies of the class in PermGen?

Yes, all classes are qualified by the classloader that brought them into
the JVM.  There cannot be duplicates within a given classloader's space,
but each classloader theoretically could have its own copy of a given
class.

Read the Tomcat doc for more details:
http://tomcat.apache.org/tomcat-5.5-doc/class-loader-howto.html

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

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

Reply via email to