kamnani commented on a change in pull request #354:
URL: https://github.com/apache/tomcat/pull/354#discussion_r485073735



##########
File path: java/org/apache/catalina/startup/ContextConfig.java
##########
@@ -1374,7 +1383,19 @@ protected void webConfig() {
     protected void processClasses(WebXml webXml, Set<WebXml> orderedFragments) 
{
         // Step 4. Process /WEB-INF/classes for annotations and
         // @HandlesTypes matches
-        Map<String, JavaClassCacheEntry> javaClassCache = new HashMap<>();
+
+        Map<String, JavaClassCacheEntry> javaClassCache;
+
+        if (context.getParent() instanceof Host) {
+           Host host = (Host) context.getParent();
+            Container container = host.getParent();
+            CONCURRENCY_LEVEL = container.getStartStopThreads();
+            javaClassCache = new ConcurrentHashMap<>(DEFAULT_CLASS_CACHE_SIZE, 
DEFAULT_LOAD_FACTOR,
+                    CONCURRENCY_LEVEL);
+        } else {
+            javaClassCache = new ConcurrentHashMap<>(DEFAULT_CLASS_CACHE_SIZE, 
DEFAULT_LOAD_FACTOR,
+                    CONCURRENCY_LEVEL);
+        }

Review comment:
       Have added the default behavior without the flag in the latest commit.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



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

Reply via email to