imaNNeo / imaNNeo/fl_chart

Memory bloat/leak when using zoom multiple times on LineChart and as a consequence app freeze

Open
#1,937 6 comments 1 reaction 0 assignees View on GitHub
Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

Took the latest sources from main, compiled with no modification and run the FL Chart App.
Pressed 150 times in very close succesion on the + (Zoom in) button in Bitcoin Price History Chart.
The app grows up until 1.5 GB RAM and it freezes, is rendered unusable.

I have come up with this scenario since we are using FLChart in a desktop app and we have linechart with two y axis and when zooming this chart with around 64k spots after zooming in 10/20 times the app consumes a lot of RAM and freezes. Some similar plots with only one axis and maybe other small differences don't display this issue so it might be related also to the numbers on the x/y axis (this is just a hypothesis).

Please let me know in case you want more information.

![Image](https://github.com/user-attachments/assets/a908bca2-6e28-4f0e-b39b-3fa36bcbe1b3)

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue in the FL Chart App by repeatedly zooming the Bitcoin Price History LineChart, including the two-axis and roughly 64k-spot scenario described. Compare memory usage and responsiveness with simpler charts, then identify and verify the cause of the growth; done means repeated zooming no longer causes unbounded RAM usage or freezes.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
frontend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.