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

potential memory leak with annotationActionValidatorManager

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.20
    • Fix Version/s: 2.3.28, 2.5
    • Component/s: XML Validators
    • Labels:
      None

      Description

      We've recently been having issues with our app crashing and trying to track down the root causes. One of the things we've seen is that over the course of 1 day, 50% of our memory (almost 620 MB of 1.2 GB) is allocated to "com.opensymphony.xwork.validator.AnnotationActionValidatorManager" according to the heap dump. We also see millions of entries in two SynchronizedMap's:

      • validatorCache (1,635,019 entries)
      • validatorFileCache (87,321 entries)

      Looking through the entries in the validator cache, we se entries for every unique page browsed within the app. Note: we're using staticParam mapping and NamedVariable PatternMatching in action names e.g. "${id}/${slug}" so effectively every url is unique.

      Looking at the source code, should these maps perhaps be "WeakHashMaps" or WeakReferences so that they're disposed of?

      (source code to the app is here: https://bitbucket.org/tdar/tdar.src/src )

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                lukaszlenart Lukasz Lenart
                Reporter:
                abrin adam brin
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: