> From: Christopher Schultz [mailto:[EMAIL PROTECTED] 
> Subject: Re: Memory leaks on webapp redeploy
> 
> Maybe this issue has been fixed in recent VMs (IIRC, older 
> VMs -- maybe 1.3-era -- would never discard java.lang.Class
> objects.

Not true either.  I've been porting Sun's JVMs to various platforms
since 1.2, and GC of classes has always been available (not sure about
1.1).

> Java 1.5 has the "-Xnoclassgc" option

That's also been around since at least 1.3.

> For instance, if you had a singleton with a static instance of the
> class, but no references to the Class object, no instances other than
> the singleton (a reasonable assumption for a singleton), and 
> no outside references to the singleton object, then the VM is within 
> it's rights to discard both the instance and the Class since they are 
> "unused". I seem to recall this being a problem for folks who thought
> that singletons were a good idea, and so the Java folks decided to
keep
> Class objects around forever.

The first part is true, the latter conclusion isn't, at least not in
Sun-based JVMs.  You do have to be careful if only reflection is used to
access a class, since it can disappear as you described.

> Or am I just crazy and making the whole thing up? ;)

Always a possibility, especially in this business :-)

 - 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