tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 53085] New: [perf] [concurrency] DefaultInstanceManager.annotationCache is not optimal for more threads
Date Mon, 16 Apr 2012 18:42:12 GMT

             Bug #: 53085
           Summary: [perf] [concurrency]
                    DefaultInstanceManager.annotationCache is not optimal
                    for more threads
           Product: Tomcat 7
           Version: 7.0.26
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: Catalina
    Classification: Unclassified

Created attachment 28616
Screenshot : Thread states during test

This is a small Concurrency problem also find during myfaces performance
testing [1]

org.apache.catalina.core.DefaultInstanceManager.annotationCache uses
WeakHashMap for cache, but this approach needs sychronized get() access. This
can lead to complete thread stuck at this lock - see attached screenshots from
yourkit profiler. 

I think this problem is classical concurrent cache problem = many read but only
few put()s, reads vastly outnumber writes. It this case is should be read
without locking otherwise it is a concurrency bottleneck.

I didn't check the code of DefaultInstanceManager deeply, following are
suggestions only:
1) Normally is this concurrent-cache solvable with ConcurrentHashMap or with
maps based on this type like [2] or [3]
2) the 'weakness' can achieved with String (classname) if it is acceptable to
maintain annotations for class that can be already unloaded or with


Configure bugmail:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message