Search code examples
gradlemulti-project

Gradle multi-project parallel build consumes 100% of CPU time


System info
enter image description here

Software info
OS:
enter image description here
Java: OpenJDK 12.0.2
Gradle: 5.6.2

The issue Building Gradle multi-project with parallel builds enabled consumes almost all the CPU time. PC is not interactable during the build process

Steps to reproduce
1. git clone --recursive https://github.com/vividus-framework/vividus.git
2. cd vividus
3. ./gradlew build


Solution

  • In your gradle.properties file (or GRADLE_OPTS environment variable), try setting org.gradle.priority=low. On my machine it has a noticeable effect with parallel enabled, but I've also heard from some of my co-workers with older machines that this setting didn't help them too much.

    You can also experiment with setting org.gradle.workers.max. It defaults to the number of CPU processors. Maybe set it to the number of logical processors minus one.

    If it still stops you from interacting with your computer during the build, you should probably just disable parallel execution and let Gradle work on a single processor.