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
[TIMOB-23715] Android: Fix TiBaseActivity and TiUIView memory leaks #8616
Conversation
test this please |
test this please |
Running your test case and the one reported in the ticket. I still get leaked activities from both test cases. Seems there are still contexts leaking in TiCompositeLayout for one example. |
b77e1ce
to
3d1e4a4
Compare
3d1e4a4
to
ace1331
Compare
@fmerzadyan Updated PR |
test this please |
The leaks are whittled down 👍 but a few still remain. Add this snippet to
After adding this your test case has no leaks but there are leaks in original test case. Maybe populate your list view and inspect list view items: |
@fmerzadyan The |
Mutable static variables are not garbage collected. Developers must explicitly nullify these variables. Plus it was flagged up when profiling Java heap. |
You're right, but it's done purposefully to reuse the inflater object again when a new ListView is created. Which is why this is in the constructor, to not recreate the inflater object again: if (inflater == null) {
inflater = (LayoutInflater)activity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
} |
CR && FT PASS |
TiListView
TiBaseActivity
andTiUIView
TEST CASE
JIRA Ticket