Skip to content

Give inject-java's Groovy test compilation a 3 GB compiler daemon of its own - #14187

Merged
graemerocher merged 1 commit into
5.2.xfrom
claude/inject-java-groovy-compile-heap
Oct 29, 2026
Merged

graemerocher merged 1 commit into
5.2.xfrom
claude/inject-java-groovy-compile-heap

Conversation

@graemerocher

@graemerocher graemerocher commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

:micronaut-inject-java:compileTestGroovy failed in CI with Java heap space (run 40775026597, 32 minutes into the build).

The convention forks Groovy compilations with a 2 GB heap, and Gradle reuses compiler daemons across the Groovy compilations of different projects. The inject-java test sources are the largest Groovy compilation of the build. In a daemon that has compiled other Groovy test sources first, part of their memory is still live when inject-java's compilation runs, and the 2 GB ceiling is not enough.

Measured locally from GC logs of the compiler daemons (-Xlog:gc*), compiling the Groovy tests of inject-groovy, http-server-netty, inject-java and runtime with --max-workers=1, so one daemon is reused for all of them:

daemon peak heap after GC
5.3.x, before one shared 2 GB daemon full GC 2047M->1559M(2048M), then 1866M at remark
5.2.x, before one shared 2 GB daemon 1784M of 2048M
5.2.x, after 2 GB daemon for the other three 973M
5.2.x, after 3 GB daemon for inject-java 742M

Compiled on its own in a fresh daemon, inject-java's Groovy tests peak at about 1.1 GB live on 5.3.x and 0.75 GB on 5.2.x.

This change gives compileTestGroovy of inject-java memoryMaximumSize = "3g":

  • it gets more headroom;
  • it always runs in a daemon of its own, because Gradle does not reuse a daemon with a smaller heap for it.

Other Groovy compilations keep the 2 GB of the convention. This starts one extra compiler daemon for this task. The 3 GB is a ceiling: the daemon uses only the heap the compilation needs.

…n of its own: in a daemon reused from other Groovy compilations it ran out of the 2 GB of the convention
@graemerocher graemerocher mentioned this pull request Oct 29, 2026
7 tasks
@graemerocher
graemerocher marked this pull request as ready for review October 29, 2026 12:08
@sonarqubecloud

Copy link
Copy Markdown

@graemerocher
graemerocher merged commit cf8c3b8 into 5.2.x Oct 29, 2026
23 checks passed
@graemerocher
graemerocher deleted the claude/inject-java-groovy-compile-heap branch October 29, 2026 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants