-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Android Embedding unconditionally calls NotifyLowMemory in onTrimMemory #90551
Comments
One thought is that if we have not yet rendered a frame, we should avoid notifying unless the memory is *CRITICAL. |
Added a little instrumentation and this may be appropriate in the specific case of the trace I'm seeing, even if our level detection is a little suspicious. |
right. Do you know where the 250ms are spent? is it in 0ms for the LRU cache seems very low, isn't it? |
(This time the trim memory was almost certainly a |
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 |
Specifically, here:
https://github.com/flutter/engine/blob/dd28b6f1c8e68089dab16ebce9f629f309690027/shell/platform/android/io/flutter/embedding/android/FlutterActivityAndFragmentDelegate.java#L781-L786
Whereas we only notify the application code if the memory level is RUNNING_LOW, which also seems like a bug.
It seems like we should also notify the application if we have RUNNING_CRITICAL or if it's the LOW/CRITICAL for not running.
It also seems like we should check at least for RUNNING_LOW/RUNNING_CRITICAL before telling the Dart VM to potentially GC. On lower end devices, I've observed this particular codepath triggering a 250ms during the critical path to first frame.
The text was updated successfully, but these errors were encountered: