Skip to content

Memory leak in effect runner #3402

@dennisrijsdijk

Description

@dennisrijsdijk

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

In Firebot setups that are running for long periods of time, and/or have effects running frequently (eg. on 1 second timers), Firebot leaks a problematic amount of memory because the AbortSignals don't get garbage collected due to their eventListeners not being removed. This can ultimately result in Firebot crashing.

Expected Behavior

No response

Steps To Reproduce

Note: These steps are unrealistic, but they're a relatively quick way to see the issue. In realistic use cases, it may take days for the memory usage to become problematic.

  1. Create a Counter. Inside the counter, create a "Log Message" effect which logs the following message: Debug Counter: $counterNewValue
  2. Create a Timer with a 1 second interval, 0 chat lines, not only run when live
  3. Add a "Loop Effects" to the timer with a loop count of 100
  4. Inside of the loop, create a "Update Counter" effect and increment the earlier created counter by 1
  5. Save the timer and make sure it is enabled
  6. Wait for a few minutes and observe Firebot's RAM usage increasing in task manager.
  7. After waiting for a while, disable the timer and observe memory usage doesn't meaningfully go down

Version

v5.65.3

What operating system are you using Firebot on?

Windows 11

Relevant log output

Contact Details (Optional)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions