Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-4790

struts 2.5.10.1 upgrade cause more frequent garbage collection

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Cannot Reproduce
    • Affects Version/s: 2.5.10
    • Fix Version/s: 2.5.12
    • Component/s: Core
    • Labels:
      None
    • Environment:

      production
      tomcat 7.0.59

      Description

      since we upgraded our struts version from 2.1.18 to 2.5.10.1, our app has been doing a lot of garbage collection, CPU are up more 30%-40%. We have 2 application that yield same results after the upgrade. Stress test has almost double the time in performance. these are the tech stack of our apps.

      struts 2.5.10.1
      spring 3.29
      tiles 3

      any insight would be helpful.
      Thank you
      Tam

        Activity

        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Can you use a profiler to check in which area your apps are performing such operations?

        Show
        lukaszlenart Lukasz Lenart added a comment - Can you use a profiler to check in which area your apps are performing such operations?
        Hide
        nguy0310 Tam Nguyen added a comment - - edited

        thank you so much for responding.

        I'm not familiar with using a profiler to check, but it seems to effect every state of our app. this is our config properties.

        struts.ui.theme=simple
        struts.multipart.parser=jakarta-stream
        struts.multipart.maxSize=20971520
        struts.url.includeParams=none
        struts.ognl.allowStaticMethodAccess=true
        struts.ognl.enableExpressionCache=false
        struts.serve.static=true

        we used all most of the standard strut tags <s:checkbox, <s:property>

        do you see any setting that I'm not setting that could cause the GC and CPU to spike ?

        Show
        nguy0310 Tam Nguyen added a comment - - edited thank you so much for responding. I'm not familiar with using a profiler to check, but it seems to effect every state of our app. this is our config properties. struts.ui.theme=simple struts.multipart.parser=jakarta-stream struts.multipart.maxSize=20971520 struts.url.includeParams=none struts.ognl.allowStaticMethodAccess=true struts.ognl.enableExpressionCache=false struts.serve.static=true we used all most of the standard strut tags <s:checkbox, <s:property> do you see any setting that I'm not setting that could cause the GC and CPU to spike ?
        Hide
        lukaszlenart Lukasz Lenart added a comment -
        Show
        lukaszlenart Lukasz Lenart added a comment - Have you read this http://struts.apache.org/docs/performance-tuning.html ?
        Hide
        lukaszlenart Lukasz Lenart added a comment - - edited

        Why did you disable the cache with struts.ognl.enableExpressionCache?

        Show
        lukaszlenart Lukasz Lenart added a comment - - edited Why did you disable the cache with struts.ognl.enableExpressionCache ?
        Hide
        nguy0310 Tam Nguyen added a comment - - edited

        it was our legacy code. Should this be enable ? We just turn it back on and it show some difference in performance.

        Also I enable these flags :

        <constant name="struts.freemarker.templatesCache" value="true" />
        <constant name="struts.freemarker.templatesCache.updateDelay" value="86400" />

        Show
        nguy0310 Tam Nguyen added a comment - - edited it was our legacy code. Should this be enable ? We just turn it back on and it show some difference in performance. Also I enable these flags : <constant name="struts.freemarker.templatesCache" value="true" /> <constant name="struts.freemarker.templatesCache.updateDelay" value="86400" />
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Yes, it should be enabled.

        Show
        lukaszlenart Lukasz Lenart added a comment - Yes, it should be enabled.
        Hide
        nguy0310 Tam Nguyen added a comment -

        with the two additional flags being set :
        struts.freemarker.templatesCache
        struts.freemarker.templatesCache.updateDelay

        it seems the performance went down so we're just going to stick with
        struts.ognl.enableExpressionCach = true

        This seems to help a lot, so thanks for confirming that we need this on. We will do a stress test soon and see how it's compare with our baseline. My biggest question still remain opened is why are we getting more garbage collection since we upgrade to 2.5.10.1 ?

        Thanks
        Tam

        Show
        nguy0310 Tam Nguyen added a comment - with the two additional flags being set : struts.freemarker.templatesCache struts.freemarker.templatesCache.updateDelay it seems the performance went down so we're just going to stick with struts.ognl.enableExpressionCach = true This seems to help a lot, so thanks for confirming that we need this on. We will do a stress test soon and see how it's compare with our baseline. My biggest question still remain opened is why are we getting more garbage collection since we upgrade to 2.5.10.1 ? Thanks Tam
        Hide
        lukaszlenart Lukasz Lenart added a comment - - edited

        You have migrated from a very old version, also you have switched to the latest Java version so it's hard to say why GC runs so often...

        Show
        lukaszlenart Lukasz Lenart added a comment - - edited You have migrated from a very old version, also you have switched to the latest Java version so it's hard to say why GC runs so often...
        Hide
        lukaszlenart Lukasz Lenart added a comment -

        Feel free to re-open when you will have a new info

        Show
        lukaszlenart Lukasz Lenart added a comment - Feel free to re-open when you will have a new info

          People

          • Assignee:
            lukaszlenart Lukasz Lenart
            Reporter:
            nguy0310 Tam Nguyen
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development