Skip to content

Conversation

@longv
Copy link

@longv longv commented Sep 10, 2025

It seems that when max and min are not set, the AxisBase.mDecimals is updated to infinity and thus cause Out Of Memory as DefaultAxisValueFormatter create a StringBuffer. There is a similar issue opened in the original repo.

Even though we can enable granularity to prevent this, I think it's better to have a guard in case developers are not aware of the granularity option. Hence, I have copied the propose change here.

@hannesa2
Copy link
Collaborator

Thank you.
Is there a way to test this OOM before this pull request. Best as a pull request in this repository ?

@hannesa2 hannesa2 changed the title fix: Fix OOM when create DefaultAxisValueFormatter Fix OOM when create DefaultAxisValueFormatter Sep 10, 2025
@hannesa2 hannesa2 added the bugfix Something isn't working label Sep 10, 2025
@hannesa2 hannesa2 merged commit 6e56f34 into AppDevNext:master Sep 10, 2025
2 checks passed
@hannesa2
Copy link
Collaborator

Ohh, I merged too early

@longv
Copy link
Author

longv commented Sep 10, 2025

Ohh, I merged too early

Oh I was about to answer 😅. You can revert it if you want. It's maybe hard to reproduce but I can try and create the PR again.

@hannesa2
Copy link
Collaborator

Yes, maybe it's hard to produce, but it would be nice, to have the OOM situation and see afterward the benefit of this pull request.
Following this idea, the pull request needs first the revert of this to point it out

longv added a commit to longv/AndroidChart that referenced this pull request Sep 11, 2025
This reverts commit 6e56f34, reversing
changes made to c04f3bd.
hannesa2 added a commit that referenced this pull request Sep 11, 2025
Revert "Merge pull request #407 from longv/chart-oom"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants