-
Notifications
You must be signed in to change notification settings - Fork 27.1k
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
Out of memory issue on iOS archive #60802
Comments
Getting the same for Android and iOS after upgrading a bigger project from stable to latest beta. |
FYI @alexmarkov , looks like a crash in TFA |
It looks like TFA runs out of memory. TFA is a whole-program analysis and may inherently consume a lot of memory if the input program is large. @dna-f @kuhnroyal How big is the application you're trying to build? Does it have a lot of auto-generated Dart code? 2Gb doesn't sound like too much for TFA: I've seen TFA consuming up to ~4Gb of memory on large apps. Dart VM should grow the heap as needed up to a much higher limit (at least on 64-bit systems). Also, I don't recall any recent changes in TFA which could result in a much higher memory usage. @rmacnak-google @dnfield Are there are recent changes in GC behavior which may result in these out of memory errors? |
There are no recent GC changes that would cause a program that previously succeed to OOM. (There is the older change of parallel scavenge that sometimes makes the proper Dart OutOfMemoryError become the FATAL in scavenger.cc, but the program would OOM either way.) |
It should be pretty difficult to run out of memory on macOS, which I believe will typically let you use far more than the amount of physical memory installed on the machine. It would be helpful to see a reproduction of this. I'm curious how much memory it's trying to allocate when it fails here: https://github.com/dart-lang/sdk/blob/084f9faf813bda21c9b5394d8afadab185b53bfb/runtime/vm/heap/scavenger.cc#L281 My guess right now is that it's already at a few GB and it requests some insane number of bytes for that malloc to fail. |
If you cannot share a reproduction program for this, it would also help if someone experiencing it can bisect to a specific commit (ideally to a specific Dart roll into the engine, but even just a specific engine roll would be more helpful right now). You can use the |
@alexmarkov 43.298 lines of Dart code including ~20.000 generated from moor and built_value libraries. Build is running on MacOS Catalina, it is however running in some VM which might have a memory limit. Will get back to you on that. |
What is TFA? 🤔 I can test tomorrow if this also occurs on my own machine. |
@kuhnroyal TFA is a type flow analysis, the whole-program analysis used by Dart AOT compiler. |
@alexmarkov I tried this on my machine with 16GB MacOS Catalina. It also fails here running Flutter 1.17.5: |
Here is the log from the Android build: Log output
|
Thanks, @kuhnroyal ! The memory usage hasn't grown. There is |
I think we removed that flag once we determined the issue was caused by the truncated dill file: #58525 Though that might not be in this particular version |
Hi @alexmarkov, Didn't try git bisect yet. You can find some top screenshots attached. The second one ends correctly, reaching more memory usage than the first, 2296M and even more ~2400M (1.18.0-11.1.pre) |
The limit was first in dev in 1.19.0-2.0.pre and removed in 1.19.0-5.0.pre. I believe this range contains 1.19.0-4.3.pre5. |
@kuhnroyal @dna-f Could you try a newer version of Flutter and confirm that the problem is fixed? |
Yea, I just tried locally with 1.19.0-5.0.pre and it completes while using 2800m. Gonna send this to CI and report back. Edit: Builds on CI as well now! |
Everything ok for me too |
Thank you for the confirmation. |
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 |
Hi guys,
I'm facing an Out of memory issue while compiling the iOS release version of my my app using channel Beta version 1.19.0-4.1.pre or 1.19.0-4.2.pre
No problems instead with versions 1.18.0-11.1.pre or minor.
This is my flutter doctor -v log
And this is the build error while executing an Archive operation from Xcode or after executing the following command:
flutter build ios --release --target lib/main.dart --flavor production --verbose
The dart process takes more than 2gb of memory and then it crashes
If I downgrade the engine everything works fine
flutter downgrade 1.18.0-11.1.pre
Yesterday I tried to upgrade to version 1.19.0-4.3.pre on Beta channel but I got another error.
The text was updated successfully, but these errors were encountered: