Skip to content

Exponential memory leak and performance degradation when using responsive options with multiple instances #5148

@monsieurvor

Description

@monsieurvor

Description

A significant memory leak occurs when 3 or more chart instances are initialized with responsive configuration options and subjected to data updates via updateSeries. Memory usage scales exponentially, reaching several gigabytes after a few update triggers. This is accompanied by an exponential increase in render times.

Steps to Reproduce

  1. Initialize 3 or more chart instances.

  2. Ensure your browser width doesn't hit the responsive breakpoint

  3. Include a responsive array in the chart options for each instance.

  4. Call updateSeries repeatedly on all instances.

  5. Monitor the JS Heap and render durations.

Expected Behavior

Memory usage should remain stable, and updateSeries execution time should remain consistent across updates.

Actual Behavior

Memory: The JS heap size grows by hundreds of megabytes per update cycle.

Performance: Render times increase from ~50ms to 10+ seconds after 8 updates.

Heap Analysis: Comparison of heap snapshots shows an exponential increase in the number of config and internal state objects.

Reproduction Link

https://codepen.io/monsieurvor/pen/LEZYMvV

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