Skip to content

bric3/gradle-cgroup2-patcher

Repository files navigation

Enable cgroup v2 for Gradle [8.1;9.3[

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.jar

Background

When 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.

License

Since this patch modifies Gradle’s internal files, it is licensed under the same license as Gradle itself, which is the Apache License, Version 2.0.

About

Java agent to patch Gradle 8.x with cgroup v2 support for better memory detection in containers

Topics

Resources

License

Apache-2.0, Unknown licenses found

Licenses found

Apache-2.0
LICENSE
Unknown
LICENSE-HEADER

Stars

Watchers

Forks

Contributors

Languages