4

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

JDurstberger
  • 4,127
  • 8
  • 31
  • 68

1 Answers1

9

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.

JDurstberger
  • 4,127
  • 8
  • 31
  • 68
  • 1
    My configuration to use first 6 cores: C:\Windows\System32\cmd.exe /c start "AndroidStudio" /affinity 3F "C:\AndroidStudio\bin\studio64.exe" – Nikita Axyonov Jun 27 '16 at 20:57
  • 0x03 = 3 in decimal bro not 2 – Lcukerd Jan 04 '18 at 07:03
  • Actually the number is the binary mask, for example 0xAA (10101010) requests that your process run using processors 1, 3, 5 and 7, but not 0, 2, 4 or 6 https://stackoverflow.com/a/7760105/2093236 – Dmide Mar 29 '18 at 11:25