-
-
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
[3.2.0] Excessive Memory leaks in Swift 4.2 related to LineChartView, not present in 3.1.1 w/Swift 4 #3649
Comments
about memory leak is a bit tricky, you can look at #2772 #2745. Sometimes it's not Charts problem, but swift library's. You need to give detailed logs, graphs to illustrate. Also, what I found to make sure the real leak is if you try to pop the current view controller, if chart related objects are still there, that's what you should look into. |
I use a separate class for the value formatter following IAxisValueFormatter protocol. In 3.2.0 I get retain cycles between the formatter and my class by using line chart (I have not tested other charts so far). In previous 3.1.1 release I don't get this behavior. I am using latest Xcode 10 (10A255) with Swift 4.2. |
IAxisValueFormatter will create retain cycle if you are not very careful. |
Note: This also occurs in 3.2.1 It looks like #3680 will fix it |
please check if #3680 fixed it |
@liuxuan30 It worked! Just ran through a bunch of tests with the current master and it appears to be fixed. Thanks! |
thanks for help confirm! |
@liuxuan30 Isn't it a good time to create new release of Charts with memory fixes? |
@liuxuan30 +1, I would love to switch back to normal charts in my podfile. I've been using the fix in production for months. |
What did you do?
Existing project has charts inside a collection view cell primarily consisting of a LineChartView.
What did you expect to happen?
No leaks
What happened instead?
With no other code changes, the exact same project generates 100's of leaks in Swift 4.2/v3.2.0 and zero in Swift 4.0 / 3.1.1.
The leaks seem to revolve around data items strongly retaining a reference to their parent chart view. Dismissing the page/complete deinit on the UICollectionView works fine, but the more items that go into the chart the more leaks you end up with.
Charts Environment
Charts version/Branch/Commit Number: 3.2.0
Xcode version: 10.0
Swift version: 4.2
Platform(s) running Charts: iOS
macOS version running Xcode: 10.13.6
Demo Project
-Will Update Tomorrow with sample
The text was updated successfully, but these errors were encountered: