Enable cgroup v2 support for Gradle versions from 8.1 (inclusive) to 9.3 (exclusive).
|
Caution
|
This patch modifies Gradle’s internal files. This agent has presently no fail guard. Use it at your own risk and always back up your files before applying any changes. |
Coordinate: io.github.bric3.gradle.cgroup2.patcher:gradle-cgroup2-patcher:0.0.1
Apply this patch using the Gradle property
org.gradle.jvmargs=-javaagent:path/to/gradle-cgroup2-patcher-0.0.1.jarWhen running Gradle builds inside containers (e.g., Docker), Gradle relies on cgroup to determine the available system resources (CPU, memory, etc.) to optimize its performance.
Gradle introduced support for cgroup v1 starting from version 8.1 (actually 8.1 RC1), see
Gradle PR #23944.
And a new PR was added to support cgroup v2 in Gradle 9.3, see
Gradle issue #26065 (PR #34883).
At this time, only Gradle 9.3 RC1 is released, and it’s unlikely we’ll see a backport for 8.x series.