-
-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Memory leak in Line Chart data #2772
Comments
I've had this problem, too 😰 |
open func addDataSet(_ d: IChartDataSet!) |
when you pop back, do you see I would guess there is really nothing we can do if it's swift leak, as I don't see obvious mistake in the library code. But you are welcome to help debug as well. #2425 possible dup. As #2425 said, sometimes instruments would report false leak. Just FYI I recently receive an email that my old radar is closed, and maybe fixed in Xcode 9. So we can try later as well. |
I had same problem with memory leak, I had over 2000 memory leak problems with this (in many lines of code, all for this Charts pod) and my solution was this:
This solved my problem, after this I didn't have memory leak anymore, anywhere Hope this helps, |
Thanks a lot,I will try your suggestion
later.🤝
Sent from my iPhone
On 7 Dec 2017, at 22:23, DamirDjozicCoing <[email protected]<mailto:[email protected]>> wrote:
I had same problem with memory leak, I had over 2000 memory leak problems with this (in many lines of code, all for this Charts pod) and my solution was this:
1. Go to definition of HorizontalBarChartView
2. there you will see, in init method that HorizontalBarChartRenderer is being called, so go to "HorizontalBarChartRenderer" definition
3. go to "BarChartRenderer" definition from there
4. This is the catch: make "dataProvider" variable weak
e.g. @objc<https://github.com/objc> open weak var dataProvider: BarChartDataProvider?
5. go back to HorizontalBarChartView
6. go to definition of "XAxisRendererHorizontalBarChart"
7. This is the catch: make "chart" variable weak also
This solved my problem, after this I didn't have memory leak anymore, anywhere
Hope this helps,
Cheers!
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub<#2772 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/APYXYG2_0BowPNyji62TaQsHuVU__n29ks5s9_TigaJpZM4PNzqR>.
|
@DamirDjozicCoing I will check what you said. Thanks! |
@DamirDjozicCoing in our code base,
but for XAxisRendererHorizontalBarChart, |
Cool. My mistake about the first thing (that is already weak), I played with it so I probably thought that I put "weak" there also but I didn't. Anyways, it should be weak. As for legend, I didn't use legend in my app, but I can check and see. Maybe it is the same problem like this but for some other variable. |
Hey @liuxuan30 unfortunately I do not have access anymore of the source code that contains this issue. |
Thanks for your help @DamirDjozicCoing ! |
No problem, I'm glad I could help!! @liuxuan30 |
Memory Leak in Line Chart
When popping screen back or selecting another tab from the UITabBarController, there will be a memory leak that'll occur from the chart.
Attached are screenshots from Instruments. Please advise on how to proceed with solving this problem.
Thanks!
The text was updated successfully, but these errors were encountered: