Wicket
  1. Wicket
  2. WICKET-2741

non-performant Collections.synchronizedMap() should be replaced with ConcurrentMap

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.6
    • Fix Version/s: 1.4.9, 1.5-M1
    • Component/s: wicket
    • Labels:

      Description

      The following two classes use Collections.synchronizedMap() --> lots of contention @ concurrent load.

      • RequestListenerInterface.interfaces
      • WebApplication.addBufferedResponse
      • Injector.inject() - 'cache' field.

      The last instance makes @SpringBean unusable in production (too much contention @ concurrent load)

      Here's a sample output of contention around monitor of class java.util.Collections$SynchronizedMap:

      +--------------------------------------------------------------------------------------+------------------+-----------------+
      |                                         Name                                         |    Time (ms)     |      Count      |
      +--------------------------------------------------------------------------------------+------------------+-----------------+
      |  +---java.util.Collections$SynchronizedMap.get(Object)                               |  126,101   51 %  |  19,145   52 %  |
      |  | |                                                                                 |                  |                 |
      |  | +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |  109,912   45 %  |  16,285   44 %  |
      |  | |                                                                                 |                  |                 |
      |  | +---org.springframework.beans.CachedIntrospectionResults.forClass(Class)          |   16,188    7 %  |   2,860    8 %  |
      |  |                                                                                   |                  |                 |
      |  +---java.util.Collections$SynchronizedMap.put(Object, Object)                       |  119,343   49 %  |  17,676   48 %  |
      |    |                                                                                 |                  |                 |
      |    +---org.apache.wicket.injection.Injector.inject(Object, IFieldValueFactory)       |                  |                 |
      |      |                                                                               |                  |                 |
      |      +---org.apache.wicket.injection.ConfigurableInjector.inject(Object)             |                  |                 |
      |        |                                                                             |                  |                 |
      |        +---org.apache.wicket.injection.ComponentInjector.onInstantiation(Component)  |  118,060   48 %  |  17,467   47 %  |
      |        |                                                                             |                  |                 |
      |        +---com.castanealabs.gui.model.ZipCodeValidator.<init>()                      |      686    0 %  |     106    0 %  |
      |        |                                                                             |                  |                 |
      |        +---com.castanealabs.gui.model.ProductSkuProgramDataProvider.<init>(IModel)   |      337    0 %  |      59    0 %  |
      |        |                                                                             |                  |                 |
      |        +---com.castanealabs.gui.model.ProductTypeProgramDataProvider.<init>(IModel)  |      259    0 %  |      44    0 %  |
      +--------------------------------------------------------------------------------------+------------------+-----------------+
      
      Generated by YourKit Java Profiler 8.0.22 Feb 12, 2010 3:52:25 PM
      
      1. wicket-2741.patch
        4 kB
        Stefan Fussenegger

        Issue Links

          Activity

          Igor Vaynberg made changes -
          Link This issue is duplicated by WICKET-2875 [ WICKET-2875 ]
          Igor Vaynberg made changes -
          Status Open [ 1 ] Resolved [ 5 ]
          Assignee Igor Vaynberg [ ivaynberg ]
          Fix Version/s 1.4.9 [ 12314962 ]
          Fix Version/s 1.5-M1 [ 12313078 ]
          Resolution Fixed [ 1 ]
          Stefan Fussenegger made changes -
          Attachment wicket-2741.patch [ 12444689 ]
          Nikita Tovstoles made changes -
          Field Original Value New Value
          Component/s wicket [ 12311420 ]
          Nikita Tovstoles created issue -

            People

            • Assignee:
              Igor Vaynberg
              Reporter:
              Nikita Tovstoles
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development