Too much CPU consumption after using Android Studio for few mins.
See original GitHub issueThis isn’t easily reproducible, but I can give you an insight when the problem occurs.
I open the project, start writing code in it. IDE works flawlessly for 10-12 mins, (I don’t open any other app or even emulators/simulators in the meantime, simple coding).
Slowly, I start seeing some high cpu consumption in Activity Monitor. It generally happens because of code suggestions (what we call that smart completion?). After that it becomes so much difficult to code, even a single modifier var
takes too long to get typed on the editor. I saw this and this, tried everything but nothing made any difference, I thought it could be because of some plugins, so I installed IntelliJ Idea to verify it, it worked fine for some 30-35 mins but it also started showing that lagginess.
I’m attaching the screenshot of plugins:
Here’s a one min long video showing the high CPU usage. In the video, I am simply scrolling the class in the background and nothing more, the CPU usage is over 100% most of the time. But when I restart the IDE, and work for around 10 mins, the CPU consumption is actually less than 10%, but as I said it gradually increases over time, which I don’t understand why.
In the video, when I got out of memory error, I set the memory to the recommended figure, invalidated the caches and restarted the AS, but again it didn’t much difference.
Flutter doctor: [✓] Flutter (Channel dev, 1.22.0-12.0.pre, on Mac OS X 10.15.1 19B88, locale en-GB) • Flutter version 1.22.0-12.0.pre at /Users/docs/sample/flutter • Framework revision a27c242b0e (6 days ago), 2020-09-11 17:46:57 -0400 • Engine revision fee6f9e533 • Dart version 2.10.0 (build 2.10.0-110.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3) • Android SDK at /Users/docs/Library/Android/sdk • Platform android-29, build-tools 29.0.3 • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593) • All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Xcode 11.2.1, Build version 11B500 • CocoaPods version 1.8.4
[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.0) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin version 49.0.2 • Dart plugin version 193.7547 • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
[✓] IntelliJ IDEA Community Edition (version 2020.2.2) • IntelliJ at /Applications/IntelliJ IDEA CE.app • Flutter plugin version 49.0.4 • Dart plugin version 202.7319.5
[✓] VS Code (version 1.49.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.12.2
Machine specs:
Processor: 3.4 GHz Quad-Core Intel Core i5 Memory: 24 GB 2400 MHz DDR4 macOS Catalina v10.15.1 GPU: Radeon Pro 570 4 GB
Issue Analytics
- State:
- Created 3 years ago
- Reactions:10
- Comments:27 (3 by maintainers)
Top GitHub Comments
I’m experiencing the same issue recently. IDE gets really slow after around 5-10 minutes. For me, especially when editing the Bloc file which is from the bloc & flutter_bloc package.
Can confirm that the issue seems to be related to having
part
andpart of
in the codebase