You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Title: Memory Leak: RunTask activities remain in memory after workflow completion
Issue Description
Using Visual Studio's Diagnostic Tools, we observed that RunTask activity instances are not being garbage collected after workflow completion. These instances, along with their associated contexts and cancellation tokens, remain in memory.
Diagnostic Evidence
Visual Studio Diagnostic Tools shows retained objects:
Steps to Reproduce
Create a workflow with RunTask activities,the workflow design json is 并发测试.json
Execute the workflow
Open Visual Studio Diagnostic Tools (Memory Usage)
Force GC and observe retained objects
Note that RunTask instances and associated objects remain in memory
Impact
Memory usage grows over time as workflows are executed, particularly noticeable in long-running applications with frequent workflow executions.
Environment
Elsa Version: 3.2.3
.NET Version: 8.0
Visual Studio 2022
The text was updated successfully, but these errors were encountered:
I don't think this is a memory leak because it is normal for the workflow definition and its activities to remain in memory, because workflow definitions are cached using a memory cache.
When I run your sample workflow, no matter how many times, I don't see memory consumption increasing for each run.
On second review, the WorkflowExecutionContexts should not remain in memory. I will try and see if I can reproduce this with the latest version from the main branch.
After an initial look, I don't see any evidence of an increasing count of WorkflowExecutionContexts. However, the GC doesn't immediately remove objects, so I do see it might take a brief while before they get collected (matter of seconds).
In summary, I don't see any memory leaks in the latest source code of the main branch. Perhaps you can try and test against the latest preview version?
Title: Memory Leak: RunTask activities remain in memory after workflow completion
Issue Description
Using Visual Studio's Diagnostic Tools, we observed that RunTask activity instances are not being garbage collected after workflow completion. These instances, along with their associated contexts and cancellation tokens, remain in memory.
Diagnostic Evidence
Visual Studio Diagnostic Tools shows retained objects:
Steps to Reproduce
Create a workflow with RunTask activities,the workflow design json is
并发测试.json
Execute the workflow
Open Visual Studio Diagnostic Tools (Memory Usage)
Force GC and observe retained objects
Note that RunTask instances and associated objects remain in memory
Impact
Memory usage grows over time as workflows are executed, particularly noticeable in long-running applications with frequent workflow executions.
Environment
The text was updated successfully, but these errors were encountered: