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

Memory leak of script engines when undeploying process applications

    • Icon: Bug Report Bug Report
    • Resolution: Won't Fix
    • Icon: L3 - Default L3 - Default
    • None
    • None
    • engine

      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.

        This is the controller panel for Smart Panels app

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

            Memory leak of script engines when undeploying process applications

              • Icon: Bug Report Bug Report
              • Resolution: Won't Fix
              • Icon: L3 - Default L3 - Default
              • None
              • None
              • engine

                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.

                  This is the controller panel for Smart Panels app

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

                          Created:
                          Updated:
                          Resolved:

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

                                Created:
                                Updated:
                                Resolved: