Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-2001

Memory leak related to introspection information when executing a lot of Velocity scripts with the same context

    XMLWordPrintable

    Details

    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      The Velocity context contains a cache of introspection related information (like the methods).

      It's not really clear to me what is the point of this cache since the following script will create 2 entries in this cache:

      $var.foo()
      $var.foo()
      

      Anyway the problem is that this cache can quite big and more importantly is never cleaned so if you execute a lot of scripts containing a lot of method calls you can end up crushing the memory quickly.

      Clearing that cache after each script should already help a lot (at the potential expense of some performance but, as I indicated above, right now I don't even see how this cache be useful in any way if the exact same method call cannot be reused...).

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              tmortagne Thomas Mortagne
              Reporter:
              tmortagne Thomas Mortagne
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: