Code Monkey home page Code Monkey logo

Comments (8)

rboylesDev avatar rboylesDev commented on September 23, 2024 1

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.

from elsa-core.

glime-ai avatar glime-ai commented on September 23, 2024

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 CodeActivity which may be similar to what you are experiencing with Timer or CRON activities.

To address this issue, you can try the following steps:

  1. Update Elsa to the latest version: Ensure that you are using the latest version of Elsa, as the issue might have been addressed in a newer release.

  2. Monitor Garbage Collection (GC): Use tools like dotMemory to monitor memory allocations and GC. This can help you identify if the memory is indeed not being collected.

  3. Implement IDisposable: If you have custom activities, ensure that they implement IDisposable and properly dispose of any unmanaged resources.

  4. Check for Subscriptions: Ensure that any event handlers or message subscriptions are being properly unsubscribed or disposed of to prevent memory leaks.

  5. Review Configuration: Review your Elsa configuration to ensure that you are not unintentionally retaining workflow instances in memory. For example, check if you are using a persistent workflow store and if the configuration of the store is correct.

  6. Report the Issue: If none of the above steps help, and you are using the latest version of Elsa, consider reporting the issue on the Elsa GitHub repository. Provide detailed information about your environment, the version of Elsa you are using, and the steps to reproduce the issue.

  7. Seek Community Help: You can also seek help from the Elsa community on platforms like Stack Overflow or the Elsa Slack channel. Other users or the developers might have encountered similar issues and could have solutions.

  8. Workaround: As a temporary workaround, you might consider implementing a mechanism to periodically restart your service to clear the memory until a permanent fix is available.

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.

from elsa-core.

sfmskywalker avatar sfmskywalker commented on September 23, 2024

Confirmed:

image

@rboylesDev thanks for reporting!

from elsa-core.

sfmskywalker avatar sfmskywalker commented on September 23, 2024

Actually, when I let it running, it seems to purge memory:

image

So now I am not really sure there is a memory leak 🤔

from elsa-core.

sfmskywalker avatar sfmskywalker commented on September 23, 2024

Unless the "23,4 unreachable" is a hint.

from elsa-core.

sfmskywalker avatar sfmskywalker commented on September 23, 2024

@rboylesDev Just to make sure: is the application using non-memory stores for all of the modules:

  • Workflow Management
  • Workflow Runtime

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.

from elsa-core.

rboylesDev avatar rboylesDev commented on September 23, 2024

We are using Elsa with EF Core and SQL Server. I believe these are configured correctly as it is a very simple code setup.

image

from elsa-core.

rboylesDev avatar rboylesDev commented on September 23, 2024

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.

from elsa-core.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.