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: widgets/app.dart/defaultActions holds disposed objects from being GCed #130354
Comments
cc @goderbauer |
I tried to repro this on master, and I don't see it show up in the output. I get other leaks, but not that one. Also, if I were able to reproduce this, would just making it |
This PR reproduces the issue: https://github.com/flutter/flutter/pull/130742/checks?check_run_id=15111129175 |
Okay, I can reproduce it with those diffs, thanks. From my reading of the error, it appears that the leak may be coming from a However, I don't really understand how a static member can be a leaked object in Dart. Static members are around for the lifetime of the app, AFAIK, and so by definition can't be leaked. But perhaps there's some interaction that is causing the leak detector to associate the static object with something transient. For posterity, here's the whole error context (which is a lot bigger than the part posted above):
|
Drafted explanation of the case to leak tracker documentation: dart-lang/leak_tracker#96 Does it help? |
Yes, that helps somewhat. So, in this case, that means that something, presumably the |
Right! Most likely the entire OverlayEntryWidget (or its state), should be nulled, because it will not function without the notifier anyway. |
## Description Fix three memory leaks detected by `about_test.dart`, but were really in the `Route` and `OverlayEntry` classes. ## Related Issues - Fixes #130354 ## Tests - Updates about_test.dart to not ignore the leaks anymore.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Fragment of retaining path:
Full retaining path:
text_selection_theme_test.dart:
failure1: https://github.com/polina-c/spikes/blob/master/notes/failures/2023-July-11/about_test-1.txt
failure2: https://github.com/polina-c/spikes/blob/master/notes/failures/2023-July-11/about_test-2.txt
date_range_picker_test.dart:
https://github.com/polina-c/spikes/blob/master/notes/failures/2023-July-13/date_range_picker.txt
To repro, remove leakTrackingTestConfig from packages/flutter/test/material/about_test.dart and see the modified tests failing.
To see retaining path, set:
and then click 'Debug' for the test in VSCode
PR that marks the issue: #130470
The text was updated successfully, but these errors were encountered: