Skip to content

[Bug] Memory Leak from Uncleaned ECharts Event Listeners in Graph Component #993

@yokedn

Description

@yokedn

Version

No response

Current Behavior

In the Graph.tsx component, the event listeners of the ECharts instance are not properly cleaned up when the component is unmounted. In particular, the window.resize event listener and the chart click event listener are not removed from the ECharts instance. This results in multiple listeners lingering in the memory after the component has been mounted and unmounted repeatedly, leading to the risk of memory leaks.

Current Behavior:
The window.resize event listener persists after the component is unmounted.
The event listeners bound to the ECharts instance are not removed from the instance.
Repeated component mounting and unmounting may lead to memory leaks and performance issues.

Expected Behavior

All event listeners should be cleaned up when the component is unmounted.
Global event listeners such as window.resize should be removed when the component is unmounted.
The ECharts instance should be destroyed only after all its listeners have been cleaned up.

Environment

- OS:
- Browser:

Any additional comments?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategory issues or prs related to bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions