After upgrading to latest beta channel I've notice that code completion in getting slower over time, to the point it stops working completely. Also it is freezing from time to time. What I've also noticed is that my free memory level dropped to less than 1GB (I'm having 32GB ram in my machine and usually only 10 to 12GB are used).
Restarting dart analysis brings back over 20GB of free memory.
BTW. I do have set dart.server.additional.argument to --enable-completion-model.
flutter doctor -v
[✓] Flutter (Channel beta, v1.11.0, on Linux, locale en_US.UTF-8)
• Flutter version 1.11.0 at /home/lock/bin/flutter
• Framework revision 856a90e67c (3 weeks ago), 2019-11-08 18:00:01 -0800
• Engine revision af04338413
• Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /home/lock/Android/Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• ANDROID_HOME = /home/lock/Android/Sdk
• Java binary at: /home/lock/bin/android-studio/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Android Studio (version 3.5)
• Android Studio at /home/lock/bin/android-studio
• Flutter plugin version 41.1.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• No issues found!
I am having the exact same thing. I was wondering by it was running so slow then realised I was up to 20gb. I restarted Intellij and it was back to normal but less than 30 minutes of running we are back to 9gb. I was not having this until I updated the most recent beta
Flutter 1.11.0 • channel beta • https://github.com/flutter/flutter.git
Framework • revision 856a90e67c (3 weeks ago) • 2019-11-08 18:00:01 -0800
Engine • revision af04338413
Tools • Dart 2.7.0
The beta before did not have this
@dluksza, @georgeherby, thanks for the reports. It sounds like you're both on the current Flutter beta version (Channel beta, v1.11.0), and didn't see the issue on the last beta?
I do have set dart.server.additional.argument to --enable-completion-model.
@dluksza, can you try disabling this option add see if the issue still reproduces? @georgeherby, can confirm whether you have this option enabled?
We'll likely need more info - analysis server logs, profiling info - to diagnose the memory consumption issues. Things will be a little slow around here as many people are OOO for the next few days.
@stereotype441 - can you follow up to get information to help diagnose the memory leak? We are seeing multiple reports of this; it's likely a recent (~flutter beta) regression.
So i did have --enable-completion-model enabled i have just disabled it and restarted Intellij and will see what memory consumption is like
So I disabled it and it has not been leaking, unfortunately, IntelliJ also just updated to 2019.3, I will enable the setting again tomorrow, to confirm that the update to IntelliJ didn't help as it also meant Dart and Flutter plugins updated for 2019.3
I can confirm that removing --enable-completion-model did stop the leak.
@lambdabaa @bwilkerson - it looks like there's a significant memory leak with the ML completion code
Hi @dluksza and @georgeherby. Could you all share a bit more about your environment / development setup and the project you were working on? Alternatively if you can follow these instructions https://github.com/JetBrains/intellij-plugins/tree/master/Dart#how-to-open-the-dart-analysis-server-with-observatory-and-dart-devtools to get a memory snapshot from the Dart analysis server, that would be hugely helpful for us in tracking down the underlying issue. Thanks!!
I will be happy to help, at a conference for the next few days so won't get a chance until Monday.
Thanks @georgeherby! Let us know if you run into any difficulties using devtools to collect memory info.
I have updated the most recent beta (hotfix 6) and I have re-enabled ML but I have not been able to replicate this anymore 🤔
So it just happened again but I didn't have the settings enabled to do the check the profile. I also did not have ML-enabled so not sure ML is anything to do with it!
Restarting Dart Analysis server resulted in a release of 16gb!
@liamappelbe So as I mentioned running with --disable-service-auth-codes --observe=8888 seemed to cause Intellij to stop providing code completion, and indexing.
So i turned it off and like clockwork as soon as i have been using Intellij for a few hours, with an iOS sim IntelliJ is up to 11gb! This is with ML turned off and seems to be something else.
When I open Activity Manager on Mac it breaks down the memory usage to 3gb for Intellij (fine) but Dart 7.73gb. I have attached a process sample from the Mac Activity Manager
PS, I may not have followed the instruction properly, as I was unsure how to set Observatory to run for a flutter project, so ended up jsut opening the localhost in Chrome
@lambdabaa So I am still getting this issue on Flutter beta, v1.14.6 :(. I am having to restart the dart analyser everything 30mins or so once it get to about 16gb of memory. I don't have ML or other arguments for Dart in Intellij.
Do you guys found a solution for that ? The problem seems to persist for me, becoming even worst.
15 minutes after launching intellijIdea, the CPU usage (from activity monitor, in macOS) shows 300 percent usage only from intellij, and if I go in details, more than 100 percent from the dart subsection (under intellij Idea).
Same here with Android Studio.