commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From skitch...@apache.org
Subject svn commit: r189563 - /jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/WrapDynaClass.java
Date Wed, 08 Jun 2005 09:16:16 GMT
Author: skitching
Date: Wed Jun  8 02:16:14 2005
New Revision: 189563

URL: http://svn.apache.org/viewcvs?rev=189563&view=rev
Log:
Added comment re potential memory leak, and safety when using shared classloader.

Modified:
    jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/WrapDynaClass.java

Modified: jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/WrapDynaClass.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/WrapDynaClass.java?rev=189563&r1=189562&r2=189563&view=diff
==============================================================================
--- jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/WrapDynaClass.java
(original)
+++ jakarta/commons/proper/beanutils/trunk/src/java/org/apache/commons/beanutils/WrapDynaClass.java
Wed Jun  8 02:16:14 2005
@@ -106,7 +106,20 @@
 
     /**
      * The set of <code>WrapDynaClass</code> instances that have ever been
-     * created, keyed by the underlying bean Class.
+     * created, keyed by the underlying bean Class. The keys to this map
+     * are Class objects, and the values are corresponding WrapDynaClass
+     * objects.
+     * <p>
+     * This static variable is safe even when this code is deployed via a
+     * shared classloader because it is keyed via a Class object. The same
+     * class loaded via two different classloaders will result in different
+     * entries in this map.
+     * <p>
+     * Note, however, that this HashMap can result in a memory leak. When
+     * this class is in a shared classloader it will retain references to
+     * classes loaded via a webapp classloader even after the webapp has been
+     * undeployed. That will prevent the entire classloader and all the classes
+     * it refers to and all their static members from being freed.
      */
     protected static HashMap dynaClasses = new HashMap();
 



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


Mime
View raw message