Repository navigation
Engine does not handle OOM well #6500
Description
Activity
- addedc: crashStack traces logged to the consoleStack traces logged to the consoleengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.
on Oct 24, 2016 There are a couple other bugs about crash reporting, see #614 and flutter-team-archive/gallery#633. We likely will need a little assistance from the Dart runtime, at least in AOT mode.
In this case, mobile OSes provide a bunch of memory callbacks we should be listening too, and probably telling the Dart VM about. I suspect we don't get much chance when we get killed from this to print a stack however.
Chrome also had a specific OutOfMemory() function which the allocator would call to make crash-stacks caused by OOMs very explicit. I don't know if Dart's allocator has such or not, but once we start collecting more crash stacks from the wild, we may want something like that.
- modified the milestones: This milestone has been deleted, This milestone has been deleted
on Feb 27, 2017 (I'm studying how flutter users diagnose and fix memory problems, so I'm following this bug - @turnidge)
We definitely need to improve this, but it's not a current priority.
Looks like there's a few related issues to this that have been closed. It's unclear to me what the scope of the bug should be right now.
There could be a very basic patch addressing this that just adds a warning log whenever Flutter gets a memory pressure signal. That would at least help devs diagnose the problem a bit when it happens, but would be noise in some cases and wouldn't give a full stack trace in actual crashes.
As far as I've been able to tell the engine doesn't have any kind of uncaught exception handling set up right now, and I think it would probably need it to be able to respond to OOM crashes specifically. Flutter itself can integrate with Sentry (#614) but I don't think that works for this since OOM exceptions aren't caught. Is that engine handling something we want to build? Couldn't find any existing issues, but may have missed something.
12 remaining items
- addedc: performanceRelates to speed or footprint issues (see "perf:" labels)Relates to speed or footprint issues (see "perf:" labels)
on Mar 4, 2020 - addedP3Issues that are less important to the Flutter projectIssues that are less important to the Flutter project
on May 29, 2020 This sounds like a neat feature. Hope it's still being looked at.
- addedteam-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
on Jul 7, 2023
When we run out of memory, we just crash. There's no clear indication of what the problem is.
flutter runjust says the application finished after printingW/ActivityManager: Force finishing activity com.yourcompany.foo/org.domokit.sky.shell.SkyActivitya couple of times, but doesn't quit. On the device, Android shows a material dialog that says "foo has stopped" with a single button "Open app again".Here's an app that demonstrates the problem:
Ideally we'd dump a stack trace of the currently running Dart code, at least.