question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Too much CPU consumption after using Android Studio for few mins.

See original GitHub issue

This 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: image

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:closed
  • Created 3 years ago
  • Reactions:10
  • Comments:27 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
jezsungcommented, Nov 21, 2020

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.

3reactions
AAverincommented, Jan 9, 2021

Can confirm that the issue seems to be related to having part and part of in the codebase

Read more comments on GitHub >

github_iconTop Results From Across the Web

Android studio using > 100% CPU at all times - Stack Overflow
I encountered a constant high cpu usage with no apparent reason. ... my android studio process and it shows GC time " 20...
Read more >
Android Studio High CPU Usage for nothing [37045344]
this is a dump when the CPU usage is 50-70% for several minutes even when idling. I'll try to get the dump for...
Read more >
How to control the 100% CPU usage, when running Android ...
How do I control the 100% CPU usage, when running Android Studio with emulator?
Read more >
Optimize your build speed | Android Developers
Long build times slow down your development process. This page provides some techniques to help resolve build speed bottlenecks.
Read more >
Hey, Windows User! Does your Android Studio uses 100 ...
Finally, I've found a solution. I've limited number of CPU Android Studio can use to 2, from default. Sience then — max 50%...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found