echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] dynamic data & time axis without showSymbol memory leak

Open JessonLiou opened this issue 1 year ago • 5 comments

Version

5.5.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=dynamic-data2&code=GYVwdgxgLglg9mABAJwIZgCZwLYBFVSoAUAlIgN4BQiiYcA7ogLy0Cmj-UrRA1HYz0QJW-AJ4kA3NUQA3VABsQrZrIVLEggLIEAFgDo0mHKUQAqRACYAjIgC0iKwAYpNZKyghkSKjRphU2KwAXLQMelBwAMpQyDBgAOakADTSNHKKwYgA2qm-Wfx68e4AYiDy8gCarKjIyaH0he6aCFA6JoJWSfWNUJzcJAC6egBWcHFEAOQA9BMkKb6-2q0GcOAYROlKJLkD0gC-UnuU8u6IGASoKlkDUidQ9Spg7Ih9RFYAnO8A7F3vXQDMkmOp2EYhUFgALGZEP8AGyORzQpwI26nTbKFhLfSGLDYEzmZHOSjAODIRAbGqIGAqZxUxAAHgcCNpMB4PDIPjOFz0AAcQABnNo4nCcYgkIFHOA82AIFSc2BQE4hTk0LgADygIQmuFE_mwMAgLwuiAAZIgACowQKIACCapg_Im-3miAicHksB5ytyMRg8SKyC1qHtjpdNBJyGwBC4gcQoEgMqQRB5NQC_I5uRoKbQ2H5KmzaayjhumdUZPOXEez1eBdzej1rCBC1c7k8SdLNArrB6rzIPA7iGmEw0A6IXZ6zTArXaDj7A6HI-bvnHRSgpXKVRq7XniC1i6XiFr_L06KyVl2S6bvj2YcQwYdAAUxlPWLGVb50FaCPAwCFgAp-VYXIjhoG9pDVO0HW9BYoFEHlMgmWBAgmW9-R5eQYCgAAZOJMnfGhBQYP8AKAhYQMQMCaFESD-Wg3xYPgrV0RQ3IACNVkwGpRAAcVQL1skcLoJmRABSCYBlQ9DMJwp46IWQj6GI-RAOA51pEA2JWFo7Jcnw2gAgQ4pUAAa2UUUWKXBiEIwp4LObKYpkQBTIlEbB2PkJTANvTsLhCCtUFUmhdgOShAKgABJF9kHSIh42gH9yQzcNSXJOQyWpFgWQZBwAFYWTZJLl25QUYGAKBSBcIrCF5AUhXQXFRVIK9yOwUQAGEdBqKA9DCgB5aUfyId8NJgLSQhyJc9J8wg_IuUtyKC_YJS6QlJCAA

Steps to Reproduce

  1. line chart with dynamic data and time axis
  2. without series.showSymbol = false
  3. take memory snapshot multi times

Current Behavior

memory rised

Expected Behavior

memory not rise

Environment

- OS: window11
- Browser: chrome 125.0.6422.112
- Framework: vanila js

Any additional comments?

Related issues: #7125, #18865

JessonLiou avatar May 30 '24 02:05 JessonLiou

correct observation, can confirm.

cnt = 0;
setInterval(function () { ...
  if (cnt++ % 20 ==0) console.log(performance.memory.usedJSHeapSize);
});

A progress table of usedJSHeapSize change after 180 (20*9) updates.

showSymbol: true showSymbol: false
130121792 42828236
144218209 47866032
151430246 47950212
156291700 49143991
160956740 50432808
174964166 46047918
180142251 47375168
188515739 48728521
201940791 44206139

However jsHeapSizeLimit is 2,172,649,472 and GC moves in mysterious ways, so I'm not sure if this is a real problem...

helgasoft avatar May 30 '24 06:05 helgasoft

In my observation, the memory will keep rising, and can't be released even I trigger GC manually. 20240530172826

JessonLiou avatar May 30 '24 09:05 JessonLiou

See related comment / screenshot of JS heap snapshots that I took before my browser tab eventually crashed: https://github.com/apache/echarts/issues/20022#issuecomment-2163282730

sjcobb avatar Jun 12 '24 15:06 sjcobb

It seems there was a recent fix related to this! https://github.com/apache/echarts/pull/20161

@plainheart can you confirm, looks like it’ll be in the next ECharts release?

sjcobb avatar Oct 11 '24 00:10 sjcobb

It seems there was a recent fix related to this! #20161

@plainheart can you confirm, looks like it’ll be in the next ECharts release?

Pulled in the nightly release with the fix from #20161 and the issue is still present. Browser tab crashes when there are many series with symbols

crash_symbols_bug crash_clone_scrnsht

sjcobb avatar Dec 11 '24 17:12 sjcobb

@JessonLiou Please check if this issue persists in v5.6.0 and file a new issue if it does.

plainheart avatar Dec 30 '24 08:12 plainheart

Closing this issue since I think this has been fixed in v5.6.0. (#20161)

plainheart avatar Dec 30 '24 08:12 plainheart