-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
dart.exe eating all memory #40243
Comments
This happens frequently when I checked the "Enable Hot UI" from settings - Languages & Frameworks -> Flutter on Android Studio. |
/cc @devoncarew seems like a bug around analysis server memory consumption. I don't know if there is anything users can do to diagnoze? |
@inohunk and @masonzhang - can you share the version of the Dart SDK that you're running? From |
@inohunk and @masonzhang - in addition to the version of the Dart SDK, it would be useful to get some info from the analyzer diagnostics web page. You can see this info by clicking on the gear icon at the left edge of the "Dart Analysis" tab and selecting "view analyzer diagnostics": Once you've opened the diagnostics page, click on "Contexts" and you should see a page with a tab for each analysis context. make sure that the "Context location" shown for each of the context tabs is a place where you actually expect to see Dart code. (Something that occasionally goes wrong for some users is that they have accidentally configured their IDE in a way that causes it to try to analyze a very large number of files, for example by pointing it to the root of their home directory). Let us know what you find out and then we can help troubleshoot further. |
@stereotype441 thanks a bunch for your feedback. my "flutter --version" command output is as following:
I viewed my analyzer diagnostics, and on here are some information for "Context files":
and nothing special on diagnostics page. In addition, this happens on my web project with the "Enable Hot UI" from settings checked. I can reproduce this by keeping change code and save. |
R=brianwilkerson@google.com, paulberry@google.com Bug: #40243 Change-Id: Iecd2a0bd4053588dfb93445918656df65bf4b60e Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/137738 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
We found an issue that might be the one causing memory leak when Hot UI is enabled. This CL https://dart-review.googlesource.com/c/sdk/+/137738 fixes it in Dart SDK, eventually it will percolate to Flutter. |
The fix landed as 3cf8c3d, and available with Dart SDK |
@inohunk and @masonzhang , have you had a chance to try and reproduce this with a newer version of Flutter as indicated above? |
currently I'm using the beta version. I'll keep you updated once I have tested it. Thanks a lot! |
Thanks @masonzhang. Closing for now, but please reopen if you continue to have issues. |
I was troubled with this issue since last week, even after upgraded the latest flutter version.
Plz fix it... Update 1: use VS Code to run is OK, but use Android Studio would happen. Update 2: Sadly, today, I use VS Code to run, this issue also happens... |
Looking at our internal benchmarks (golem benchmark analysis-server-cold-memory) I see a 75-80% spike in analysis server memory usage at bac08fb, which is included in 1210d27 (the version @yintaibing reported). @scheglov has been trying to reproduce the memory usage spike locally and hasn't had any luck so far. @sortie can you help? |
Same problem here.
|
Just a quick update to let users know we are still interested in pursuing this, and have someone who should be able to work on it soon. |
An analysis server memory issue was fixed in 838b2ec. Does that fix this issue? |
We fixed one issue that you have caused higher memory usage than necessary in 838b2ec. However because we cannot reproduce this issue per se, we cannot be sure if the fix helps here. Eventually the change will get to Flutter and might help, or not. |
what happend ??? I only run https://github.com/flutter/gallery |
Hey @xiaxiayige Dart on Flutter master and dev have been update to 2.9.0-3.0.dev, for me on linux, Flutter 1.18.0-9.0.pre.12 • channel master • https://github.com/flutter/flutter.git Flutter 1.18.0-8.0.pre • channel dev • https://github.com/flutter/flutter.git |
Thank you, I have updated, but still the same result |
Just now i had this issue in flutter app. And it happened after deleting an asset, from assets folder. Was an error of missing asset, I have replaced in code with another one, but error didn't gone. I restarted project and from that moment dart started to eat all available memmory. I tryed to fix with restarting ide, pc, rebuilding app, but nothing helped. |
Had the same issue, fixed it by running |
Faced same problem today using Android Studio. This memory consuming process is created right after I do "run". I did #40243 (comment) but it seems to be not a Dart Analysis Server, because in my case I see that Analysis Server is ok and tooks ~200mb. I tried switching to |
@jacob314 @johnniwinther It looks like it might be an issue in the |
WOW my computer is crashing a LOT after flutter 1.17 update. I just figured out that the "dart"process under Task Manager was consuming 10gb of ram!!! (my laptop has only 16) UPDATE: I did a Flutter Clean and now seems to be fixed. |
OMG, dart.exe consumed more than 10gb of my RAM. |
Had the same issue, dart.exe consuming around 6-7 Gigs RAM. Doing a Update: the issue is back again |
I experienced the same issue. a Dart process consumed more than 7gb of my total 8gb memory after i upgraded flutter to version 1.17.0. However as suggested earlier by others, |
In the Windows Task Manager, as I recall, one can right-click on the columns and say something like "select columns" -- this gives a check box list that contains an entry like "command" or "command line" or similar. Checking that (and presing ok etc) should give another column with the full command used to create the dart process which would could probably help narrow down which dart process is actually to blame. |
Contrary to my earlier observation that running flutter clean resolved memory consumption issue by dart process. Flutter clean does not offer lasting solution to this problem. The issue came up again, t Anyone with a better solution? |
@defemz if you are currently facing this issue, could you try out what I suggested above so we can figure out which exact sub-process it is, using all that memory? |
@HryhoriiZiahun @defemz @ShivamGoyal1899 To echo @jensjoha's comment, it's most helpful for the team to know exactly which subprocess is consuming memory. If it isn't the dart analyzer we'll need to open other bugs and alert other project teams to these problems. |
I have pinpointed the dart process causing the unacceptable high RAM consumption. Attached is the process as shown in Windows 10 Task manager. The highlighted entry is the culprit process: |
and how we can fix this? |
Let's fork this issue because it is a different issue. |
Filed separate issue #41862 now that we know that it is not analyzer (which is what this issue was originally about). |
If anyone can provide reproduction (in #41862) that would be great. |
How can i fix this problem. |
@alen252 try flutter clean |
flutter clean is not a permanent solution. With version 1.17.0, build takes much longer and flutter clean mostly solve for current build and not necessarily subsequent builds. |
Yes, Same Issue and yet no permanent solution only going back before 1.17 update 🙁 |
Perfectly worked. I have wasted lot of time to upgrade android and flutter sdk's but noting worked. After i executed, 'flutter clean' which saved my day. |
I am on flutter version 1.7.1 on stable channel. |
I am also facing this issue. dart.exe takes large memory. So, PC is not responding. |
I am locking this thread to prevent unrelated "me toos". The work on this problem is tracked in these two issues:
If the problem you have is dart.exe suddenly allocating a lot of memory and forcing you to reboot you can apply this workaround for now. |
When i try to run flutter app in following ide(Android Studio or Visual Studio Code) the dart.exe process is created in the Task Manager(I use windows 10 Pro) and eats up all the RAM(32GB).
I think this is related to the Dart Analysis server, since when I kill the dart process that eats up all the memory in Android Studio displays the message 'Analysis server has terminated'. This process fills RAM at a speed of ~150 MB per second. Note that usually exists several processes dart.exe, but only one of them for some reason eats all the RAM. Please, fix it.
The text was updated successfully, but these errors were encountered: