Android studio using > 100% CPU at all times - no background processes appear to be running

51,259

Solution 1

I've left this question open for awhile as coworkers and posters here have found value in various solutions over time. For myself, simply updating Android Studio solved the issue (after a number of months where none of the solutions herein worked for me).

Solution 2

Thanks to Buzzrick (answered on this page, probably above my answer), he mentioned about VCS. Turning off all of the background operations of VCS seemed to have a HUGE impact toward the high cpu usage - it was 150% and now it's 20%, more or less.

I'm on OS X

Go to: Preferences > Version Control > Background. Now listed under 'Background Operations' are 6 options. I disabled the first three options which are:

Perform update on VCS in background, Perform commit to VCS in background, Perform checkout to VCS in background.

Solution 3

You can try the following options in the File Menu:

  1. File Menu -> Invalidate Caches / Restart... -> Invalidate and Restart
  2. Enable Power Save Mode by clicking on File -> Power Save Mode

Power Save mode only disable code insights and background tasks.

Solution 4

You might consider going to File > Invalidate Caches / Restart Your cache might be kicking off something funky in the background

enter image description here

Solution 5

I encountered a constant high cpu usage with no apparent reason. Invalidating cache did not work nor did the power save mode.

In my case there was a something wrong in the '.git' directory which was causing android studio to fail in an endless loop. Checking out the repo again fixed the problem.

My advice is to check the android studio logs for any hints to what is causing it to falter. You could also start it from terminal and check the Stdout/Stderr output.

Share:
51,259
Shaun
Author by

Shaun

Updated on January 28, 2020

Comments

  • Shaun
    Shaun over 4 years

    I've noticed Android Studio (when running) uses greater than 100% CPU at all times, even when it appears there are no background processes that the IDE is running (indexing, etc). I might suspect this were something specific to my box, but some fellow developers are encountering this as well.

    Often times the CPU usage is in the high 100s or mid 200s (see screenshots below). Has anyone encountered this as well? If so, are there any strategies or options within the IDE to correct this intensive use of system resources?

    enter image description here

    enter image description here

  • bergvandenp
    bergvandenp over 10 years
    I'm expiriencing the same issue with Android Studio, but not with IntelliJ IDEA 12.1.4. So it seems to be an Android Studio specific problem, not IntelliJ itself. The problem starts when I start the build process (using maven).
  • Matt
    Matt over 10 years
    So far this has helped on Windows - though I just tested it briefly, so I can't say I'm positive it will work in the long-run, and it also seems strange that without "Power Save" the IDE would take over the entire CPU...
  • Matt
    Matt over 10 years
    Update: This helps, but it also seems to cripple some of the functionality of the IDE (like auto-complete, and some icons have disappeared, probably no realtime git support?)
  • muneikh
    muneikh about 10 years
    With the recent version of Android Studio v5+, auto complete works in Power Save mode.
  • idanakav
    idanakav almost 9 years
    This does make things better , but not really practical as it disables too many features I use.
  • McP
    McP over 8 years
    This was the case for me. I added an alias to the git config which made Android Studio unusable.
  • Simas
    Simas almost 7 years
    Similar case for me. Committing changed files and pushing to the repo fixed it.
  • Fran Marzoa
    Fran Marzoa about 6 years
    This worked great for me in Linux (Ubuntu) too. I just disabled all VCS background options and from hogging the CPU, now it's using less than 2% of it according to top. So many thanks!
  • muneikh
    muneikh almost 6 years
    Power save mode is still available in Android Studio 3.1 and has been improved since earlier versions.
  • hansonchris
    hansonchris over 5 years
    I'm on the latest stable release of Android Studio, 3.2.1, and I see this issue still.
  • Stephan Henningsen
    Stephan Henningsen over 5 years
    It's interesting how some regard this as being useful.
  • Stephan Henningsen
    Stephan Henningsen over 5 years
    Thanks for the hints on the existence of jstack. Being a first time user of this I obvisouly don't know how to use it properly, but I can see there's some VCS thread in BLOCKING state. I'm not sure if this is the root cause, but it seems to fit some of the other descriptions found here.
  • pdub
    pdub almost 5 years
    This was a MASSIVE improvement for me. Invalidate caches only did so much, but I would still regularly see well over 100% for AS and java (over 300% when building!), and now it's in the single digits at rest. I'm on AS 3.4.1, fyi.
  • John Ernest Guadalupe
    John Ernest Guadalupe almost 5 years
    I can't seem to find this "Background" menu. I perform a search in the Settings but it won't show, but when I do a Search All through the Shift keys I can see them, but clicking on them leads me nowhere. Might it be disabled?
  • Miguel P.
    Miguel P. almost 5 years
    There should be a 'Background' tab listed under 'Version Control' in settings.
  • Jason
    Jason over 4 years
    Miguel, if I wasn't married (and a guy) I would offer to have your love child. Thanks!
  • DragonFire
    DragonFire about 4 years
    The emulator seems to use a lot of energy.
  • Mahmut K.
    Mahmut K. almost 4 years
    Before: %270, After: %2. A peaceful silence in my room ...
  • zackygaurav
    zackygaurav over 3 years
    Google should mention about this setting in Official Devloper Documentation. Thanks man!
  • sud007
    sud007 over 3 years
    disabling all VCS actions in BG works like a charm! Voila! CPU usage is dropped to <1% in idle state. almos 20-40% drop for me. testted for 24 hours and more!
  • Kochchy
    Kochchy about 3 years
    yep, this helped for microsoft defender too
  • Raymond
    Raymond over 2 years
    This works on Linux Mint too. Great stuff, thanks!
  • Shoom Kloom
    Shoom Kloom almost 2 years
    This worked on Windows 10 Android Studio Chipmunk as well