简体   繁体   中英

Android Studio Build uses 100% CPU on Windows 10

After upgrading to Windows 10 building a project in Android Studio makes the PC unusable.
With Windows 10 the build did also take a long time, but the PC was useable in the meantime.

The TaskManager shows that the java-build-task uses as much CPU as it can get.

Setting java and or gradle-options did not improve the CPU usage.

Currently using:
Android Studio 2.1.0
Gradle 2.1.0
Windows 10

Creating a new shortcut which launches Android Studio with restricted CPU affinity did the trick for me.

  1. Desktop > right click > New > Shortcut
  2. Set location to cmd.exe /c start "Android Studio" /affinity 0x03 "C:\\Path\\to\\ANDROID_STUDIO"
  3. Set desired name of shortcut
  4. set Icon to C:\\path\\to\\Android Studio\\bin\\studio.ico

The number for affinity are the hexadecimal encoded numbers of the cores to use.

Core4 Core3 Core2 Core1 = 0x0F //uses all cores 
            Core2 Core1 = 0x03 //uses only first 2 cores

I experienced no noticeable worsening in build times.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM