I had to update an older Camunda to 7.23 and now we have a memory leak.
We are using the spring boot starter for 7.23 with graal vm js-scriptengine 24.2.1 (switched from nashorn). Here you can see the heap dump:
num #instances #bytes class name (module)
-------------------------------------------------------
1: 3024866 120828384 [Ljava.lang.Object; (java.base@21.0.7)
2: 2539377 101575080 com.oracle.truffle.js.runtime.builtins.JSFunctionObject$Unbound
3: 20788 66902256 [C (java.base@21.0.7)
4: 437158 58138952 [B (java.base@21.0.7)
5: 1054702 25312848 com.oracle.truffle.host.HostObject
6: 349596 22374144 com.oracle.truffle.js.runtime.objects.JSOrdinaryObject$DefaultLayout
7: 302327 19348928 com.oracle.truffle.api.frame.FrameDescriptor
The processes are executed thousands of times a day and they all contain many Business rule tasks with JS end execution listeners like so (that’s basically all the JS in the processes):
var res = execution.getVariable('decisionResult').getSingleResult();
var dto = execution.getVariable('dto');
dto.setFoo(res)
The values 1 and 2 in the heap dump are very slowly getting bigger until the heap gets out of memory, it takes about 24 hours with thousands of processes executed per day.
Any idea how this can be fixed?