Uploaded image for project: 'camunda BPM'
  1. camunda BPM
  2. CAM-10553

Memory leak of script engines when undeploying process applications

    XMLWordPrintable

    Details

    • Type: Bug Report
    • Status: Open
    • Priority: L3 - Default
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: engine
    • Labels:

      Description

      The deployment cache keeps references to the process definition object tree. It directly references ExecutableScript objects, which in turn can contain instances of javax.script.CompiledScript. Such compiled scripts typically contain references to the scripting engine they were created with (this is at least the case for Nashorn and Groovy). Since CAM-3432, script engines are created on process application level, where at least a Groovy scripting engine keeps references to its context classloader, i.e. the PA classloader. So if we now undeploy the PA, the scripting engine remains referenced via the process definition and memory leaks.

      Side note: this also essentially negates the effect of disabling script engine caching. A compiled script will always "cache" its creator. This can also lead to multi-threading issues if the script engine is not thread-safe.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              thorben.lindhauer Thorben Lindhauer
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated: