Android studio using > 100% CPU at all times - no background processes appear to be running
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:
- File Menu -> Invalidate Caches / Restart... -> Invalidate and Restart
- 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
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.
Shaun
Updated on January 28, 2020Comments
-
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?
-
bergvandenp over 10 yearsI'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 over 10 yearsSo 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 over 10 yearsUpdate: 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 about 10 yearsWith the recent version of Android Studio v5+, auto complete works in Power Save mode.
-
idanakav almost 9 yearsThis does make things better , but not really practical as it disables too many features I use.
-
McP over 8 yearsThis was the case for me. I added an alias to the git config which made Android Studio unusable.
-
Simas almost 7 yearsSimilar case for me. Committing changed files and pushing to the repo fixed it.
-
Fran Marzoa about 6 yearsThis 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 almost 6 yearsPower save mode is still available in Android Studio 3.1 and has been improved since earlier versions.
-
hansonchris over 5 yearsI'm on the latest stable release of Android Studio, 3.2.1, and I see this issue still.
-
Stephan Henningsen over 5 yearsIt's interesting how some regard this as being useful.
-
Stephan Henningsen over 5 yearsThanks 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 almost 5 yearsThis 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 almost 5 yearsI 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. almost 5 yearsThere should be a 'Background' tab listed under 'Version Control' in settings.
-
Jason over 4 yearsMiguel, if I wasn't married (and a guy) I would offer to have your love child. Thanks!
-
DragonFire about 4 yearsThe emulator seems to use a lot of energy.
-
Mahmut K. almost 4 yearsBefore: %270, After: %2. A peaceful silence in my room ...
-
zackygaurav over 3 yearsGoogle should mention about this setting in Official Devloper Documentation. Thanks man!
-
sud007 over 3 yearsdisabling 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 about 3 yearsyep, this helped for microsoft defender too
-
Raymond over 2 yearsThis works on Linux Mint too. Great stuff, thanks!
-
Shoom Kloom almost 2 yearsThis worked on Windows 10 Android Studio Chipmunk as well