-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Default CRON causes extremely high memory usage until Out of Memory exception #5312
Comments
Based on the context provided, it seems that you are experiencing a memory leak issue with Elsa 3 when using Timer or CRON triggered workflows. This is a known issue that has been reported by other users as well, as seen in the GitHub issue #4884. The issue describes a memory leak related to To address this issue, you can try the following steps:
Please note that without specific details about your environment and the version of Elsa you are using, it's challenging to provide a precise solution. If you can provide more details, I may be able to offer more targeted advice. This comment was generated by Glime. |
Oh, I forgot to mention, we are using version 3.1.2 of Elsa. So I do not believe it is the same issue as the Code Activity memory leak. |
Confirmed: @rboylesDev thanks for reporting! |
Unless the "23,4 unreachable" is a hint. |
@rboylesDev Just to make sure: is the application using non-memory stores for all of the modules:
Unless you explicitly configure the persistence provider for these two, they will use the Memory provider by default - which will most certainly lead to an increase of memory consumption as new workflow instances and execution records are stored in an in-memory dictionary. |
Minor update on our end. We decided to look at Quartz scheduler instead of the built-in scheduler. This had the same result of allocating ~200MB per scheduled workflow run and never seeming to release it. What is interesting is taking the same workflow and manually running it does not see the same jump in allocation. |
Description
We are using Elsa 3 with the default scheduling. Whenever we have a Timer or CRON triggered workflow, we have noticed jumps in memory usage when the workflow is triggered and then this memory is never garbage collected. We are running Elsa on Azure Container Apps with 1 GB of RAM. With a CRON that runs every 15 minutes, it runs for about two hours until the container app crashes with an out of memory exception and then is automatically restarted. We have experienced this memory leak as well locally, but with significantly more RAM, it is not causing issues unless it runs for days.
Steps to Reproduce
Create even a simple workflow with a Timer or CRON expression, even one that just writes to console. Allow it to run and trigger and observe memory allocations.
Expected Behavior
While a memory jump isn't unexpected, having GC run and release memory is expected.
Actual Behavior
Memory appears to not be de-allocated.
Screenshots
Here is a sample of memory usage from our container app showing the raising memory until the app crashes and restarts.
Environment
Troubleshooting Attempts
Initially we thought it might be the amount of work that the workflow is trying to do. But even a simple workflow of writing a console message or dispatching another workflow will still continue to allocate memory.
The text was updated successfully, but these errors were encountered: