Commons OGNL
  1. Commons OGNL
  2. OGNL-224

Performance - Locking and performance problem with OgnlRuntime.findParameterTypes

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.0
    • Component/s: Core Runtime
    • Labels:
    • Flags:
      Patch

      Description

      I am using struts2 and under heavy load (around 100 threads) many threads are in BLOCKED state because of OgnlRuntime.findParameterTypes(). The actions we use have a generic superclass like:
      public class PersonalCaptureAction extends DataCaptureAction<PersonalDTO>
      OGNL handles this very bad, it enters
      synchronized (_genericMethodParameterTypesCache)
      all the time, at every property access of the Action. A possible workaround is to introduce another layer of superclass that is not generic.

      I know that in current OGNL trunk (4.0-SNAPSHOT) caching has been rewritten, but Struts2 is using 3.0.5, and maybe it could be fixed as 3.0.6 in the git tree I found:
      https://github.com/jkuhnert/ognl

      I will attach a patch and a testcase.

      1. OGNL-224.patch
        6 kB
        Pelladi Gabor
      2. OgnlRuntimeTest.java
        4 kB
        Pelladi Gabor

        Activity

        Lukasz Lenart made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 3.0 [ 12321842 ]
        Resolution Fixed [ 1 ]
        Lukasz Lenart made changes -
        Assignee Lukasz Lenart [ lukaszlenart ]
        Pelladi Gabor made changes -
        Attachment OgnlRuntimeTest.java [ 12549963 ]
        Pelladi Gabor made changes -
        Field Original Value New Value
        Attachment OGNL-224.patch [ 12549961 ]
        Pelladi Gabor created issue -

          People

          • Assignee:
            Lukasz Lenart
            Reporter:
            Pelladi Gabor
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development