geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r330190 - /geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
Date Wed, 02 Nov 2005 04:26:57 GMT
Author: dain
Date: Tue Nov  1 20:26:55 2005
New Revision: 330190

URL: http://svn.apache.org/viewcvs?rev=330190&view=rev
Log:
Committed GERONIMO-1118 memory leak deploying web services caused by java.bean.Introspector.getBeanInfo()

Modified:
    geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java

Modified: geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
URL: http://svn.apache.org/viewcvs/geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java?rev=330190&r1=330189&r2=330190&view=diff
==============================================================================
--- geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
(original)
+++ geronimo/trunk/modules/kernel/src/java/org/apache/geronimo/kernel/config/MultiParentClassLoader.java
Tue Nov  1 20:26:55 2005
@@ -16,24 +16,23 @@
  */
 package org.apache.geronimo.kernel.config;
 
-import java.net.URLClassLoader;
-import java.net.URL;
-import java.net.URLStreamHandlerFactory;
-import java.net.URI;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Map;
+import org.apache.commons.logging.LogFactory;
+
+import java.beans.Introspector;
 import java.io.IOException;
 import java.io.ObjectInputStream;
 import java.io.ObjectOutputStream;
 import java.io.ObjectStreamClass;
 import java.lang.reflect.Field;
-
-import javax.print.attribute.SupportedValuesAttribute;
-
-import org.apache.commons.logging.LogFactory;
+import java.net.URI;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.net.URLStreamHandlerFactory;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Map;
 
 /**
  * A MultiParentClassLoader is a simple extension of the URLClassLoader that simply changes
the single parent class
@@ -267,6 +266,11 @@
         clearSoftCache(ObjectOutputStream.class, "subclassAudits");
         clearSoftCache(ObjectStreamClass.class, "localDescs");
         clearSoftCache(ObjectStreamClass.class, "reflectors");
+
+        // The beanInfoCache in java.beans.Introspector will hold on to Classes which
+        // it has introspected. If we don't flush the cache, we may run out of
+        // Permanent Generation space.
+        Introspector.flushCaches();
     }
 
     private static class FilteringParentCL extends ClassLoader {



Mime
View raw message