tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1366955 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/startup/ContextConfig.java webapps/docs/changelog.xml
Date Sun, 29 Jul 2012 21:23:13 GMT
Author: markt
Date: Sun Jul 29 21:23:13 2012
New Revision: 1366955

URL: http://svn.apache.org/viewvc?rev=1366955&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=53535
Reduce memory footprint when performing class scanning on Context start.
Patch provided by Cedomir Igaly

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
  Merged /tomcat/trunk:r1366953

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java?rev=1366955&r1=1366954&r2=1366955&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/startup/ContextConfig.java Sun Jul 29 21:23:13
2012
@@ -2211,10 +2211,8 @@ public class ContextConfig implements Li
         Set<ServletContainerInitializer> result =
                 new HashSet<ServletContainerInitializer>();
 
-        JavaClass javaClass = cacheEntry.getJavaClass();
-
         // Super class
-        String superClassName = javaClass.getSuperclassName();
+        String superClassName = cacheEntry.getSuperclassName();
         JavaClassCacheEntry superClassCacheEntry =
                 javaClassCache.get(superClassName);
 
@@ -2234,7 +2232,7 @@ public class ContextConfig implements Li
         result.addAll(getSCIsForClass(superClassName));
 
         // Interfaces
-        for (String interfaceName : javaClass.getInterfaceNames()) {
+for (String interfaceName : cacheEntry.getInterfaceNames()) {
             JavaClassCacheEntry interfaceEntry =
                     javaClassCache.get(interfaceName);
             // A null could mean that the class not present in application or
@@ -2678,15 +2676,23 @@ public class ContextConfig implements Li
     }
 
     private static class JavaClassCacheEntry {
-        private final JavaClass javaClass;
+        public final String superclassName;
+
+        public final String[] interfaceNames;
+
         private Set<ServletContainerInitializer> sciSet = null;
 
         public JavaClassCacheEntry(JavaClass javaClass) {
-            this.javaClass = javaClass;
+            superclassName = javaClass.getSuperclassName();
+            interfaceNames = javaClass.getInterfaceNames();
+        }
+
+        public String getSuperclassName() {
+            return superclassName;
         }
 
-        public JavaClass getJavaClass() {
-            return javaClass;
+        public String[] getInterfaceNames() {
+            return interfaceNames;
         }
 
         public Set<ServletContainerInitializer> getSciSet() {

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1366955&r1=1366954&r2=1366955&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Sun Jul 29 21:23:13 2012
@@ -85,6 +85,10 @@
       <update>
         Add some HTTP status codes registered at IANA. (rjung)
       </update>
+      <fix>
+        <bug>53535</bug>: Reduce memory footprint when performing class scanning
+        on Context start. Patch provided by Cedomir Igaly. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">



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


Mime
View raw message