Skip to content

Memory Leak When Using responsive Option in Charts on Extreme Resize #5028

@Dharmil-Decode

Description

@Dharmil-Decode

Description

When using the responsive option in ApexCharts, resizing the browser window repeatedly and aggressively causes a memory leak. Charts without the responsive config do not have this issue.

In the provided reproduction, only chart1, chart30, and chart2 have the responsive configuration. Removing these charts (or just removing their responsive option) resolves the problem, confirming that the issue lies within how responsive behavior is handled.

Steps to Reproduce

  1. Open the CodePen linked below.
  2. Continuously resize the browser window back and forth (small → large → small).
  3. Monitor the memory usage in Firefox Developer Tools (Performance or Memory tab).
  4. Observe that memory usage increases over time and is not reclaimed, indicating a leak.

Expected Behavior

Charts should update responsively without leaking memory, even during frequent or extreme window resizes.

Actual Behavior

Charts with responsive configuration cause memory usage to grow continuously with each resize. This can lead to sluggish performance or browser tab crashes over time.

Screenshots

https://tinyurl.com/2a2cceuf

Reproduction Link

https://codepen.io/Dharmil-Decode/pen/WbbXyEo

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions