Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Memory Leak in ECharts Example #20751

Open
nandafandi opened this issue Feb 12, 2025 · 4 comments
Open

[Bug] Memory Leak in ECharts Example #20751

nandafandi opened this issue Feb 12, 2025 · 4 comments
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.

Comments

@nandafandi
Copy link

Version

5.6

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=line-stack&code=PYBwLglsB2AEC8sDeBYAULTtJgDYFMAuZdLM7fADzGIHIAVCXMAW3zHwCdaAaU8zAQBmNWLQDG-aB279MAXz4YsYYMGYQQxVMoFhOEAOaGudAIaUIAZ15zyVgBbAA7sX0BXfHcV2z0CCxmkDDEQma4VvhKZKrqAEbAlNp2ZEL4Qe6cRCS6AlhWZgBu-ACCVgCSgSbasI4uoeGRsD65ebAAJkFmAGoQ-K7ItU4DYRH4zSlY8t7RWAQm0O3JrVidYGbEANqTAgxMYLAAjLxijMywAEwne-cAzNdnBwAsD_uwAKyv5wBsXwcA7H9YAAOE47cg3A4ATiBhwADLDjjxTm9DldkZCjvcMY8ji8cajPgTzodfuCALqzATAAxSUS0YqcSDicK2FaCfAiOgGQwOMBstqqLRiSTSLi0GZ2QwGJY5No8vnENFwyW5SglSxWZaCgCeIGytEgbAFeSsIFwEDAABkINBskghvVsJxPM0qeQLNYrWY4vhcNq2lghDTAmAZHQkAAJSPyQhIFgsWNIKxWeS0WAAegzsHoDmssBYRj5sDt-HasDM7QAVu4rKw6bAIEJsAFxsHOKHINBDI2rNBDbBnDSANa2wzglptBLuRZmTg6gDiZmFo0iqrIOo11gDAmgZjYdAAIvhpfhxgAKAANAEoTXo9QbCuFPHf7ObLTa7TU6gMPONJ3kgRJLATxwnC7pkIW0DEAAtE8EFYHubBWsALLBNBYiFu07QEK-ZBIfgABK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_xe2oGx1yCVpQKn5VgfU681E_19OfPq812oTW21YFaz2kFVDq6We6x5xhGHbPWvs0Nrh07nOztgM08b0P2lkZXTN9dc36tbuUVZ5bYX0aTKrRt2lDEbsR126bdL1PDt3qjvTj-jP8vnL_nVK7BkaclpZxKx7ZBnvoFe8nOtkkIOokzj9tVf2gcaUB0Z4HJm2tyU6wUqHDkSPmuYXDgb1TEd5BGy5tH87MUTa5jinzq7ZsF3m0FhiIWxlk8PThmZVOttfri1HSBDOvf0pS77_bZA-eTS55A3LZ2mf85NpA4r6BSu5HK5Vz7JJMGy5bfL5Xiui6weM4C0z7W-0Q6607y3w69f9bhQj93SLo0opR3ws3bnWkV6Xdbijvm13-Yd3Rpbu7SfGvJ3Xzb0eOeit2-4_34_ttB5NtPtnAeRUuK5-4qPD8Y9gKjoEoXWARdoDFx9d7uQqsNVq793O_2DP55V4XtX-CNcmvINZqvsL26Dbr2QE3qP0cW8x5NuRtNlRnJH3tugPgxkPgepFmPpvhPoslHNskvrPt7qKq_IcEgddlvq-ibMshvgdvARHHdlcnvpgAfkfqJCfvhGntVu8nYHVlfgrgDnng1gXt2gaijODmClrpCq5H1u_pUp_sesjg6q5k6m3gAVbtjjbrjr3gTgtoAs7qGq7jAZ7igYHpPlHFysgXAXPmgVoSHlgGHjgQ1DzhloQbHqYQ9gBtKonugOgDAongANxAA

Steps to Reproduce

Hi everyone,

I'm working with an ECharts for a dynamic graph and have noticed a leak issue.

The chart runs fine initially, but over time, it appears to stack the memory usage as if the previously called ones is still there.

This happens even when data updates are handled properly, and I suspect there might be an issue with how series or event listeners are being managed.

I've shared the minimal in the link to minimal reproduction.

The way I use it is all the same with that minimal reproduction but I call it at every second with the maximum of 50 points of data per plot.

When the array size or string size isn't going up at all (only changing numbers every time) the array buffer goes bigger and bigger until it eventually stop.

Image

I would really appreciate any guidance on debugging and fixing this memory issue.

  1. Are there common pitfalls in ECharts that could cause memory leaks?
  2. Is there a recommended way to clean up or optimize dynamic updates in large datasets?
  3. Any tools or techniques for profiling and identifying the root cause?

Thanks in advance for your time and help!

Current Behavior

The memory still leaking every minutes passing and eventually comes to a stop.

Expected Behavior

Old called reference should be automatically deleted and not pilling up.

Environment

- OS: Windows 10
- Browser: Mozilla Firefox
- Framework: Javascript

Any additional comments?

No response

@nandafandi nandafandi added the bug label Feb 12, 2025
@echarts-bot echarts-bot bot added en This issue is in English pending We are not sure about whether this is a bug/new feature. labels Feb 12, 2025
@CoderLeiShuo
Copy link

是的。我用streamlit做的成绩分析系统,里面用了很多echarts的图表,刷新页面时,内存在不断上升。不知道如何解决?

@helgasoft
Copy link

Minimal Reproduction is a static chart.

@CoderLeiShuo
Copy link

CoderLeiShuo commented Feb 14, 2025 via email

@nandafandi
Copy link
Author

Minimal Reproduction is a static chart.

Should I use this example:

https://echarts.apache.org/examples/en/editor.html?c=dynamic-data2

And edit from there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug en This issue is in English pending We are not sure about whether this is a bug/new feature.
Projects
None yet
Development

No branches or pull requests

3 participants