Skip to content

Conversation

OliverO2
Copy link
Contributor

Fixes #4112

@OliverO2 OliverO2 requested a review from aSemy June 17, 2024 22:36
@aSemy
Copy link
Contributor

aSemy commented Jun 18, 2024

I thought that the JVM args used in Test tasks used org.gradle.jvmargs by default 🤔. I've fixed OOM in other projects by increasing Xmx in org.gradle.jvmargs. I'll do some testing...

UPDATE: I did some testing and I can see in the info log that this PR does correctly increase the Xmx from the default, which is too low. https://github.com/gradle/gradle/blob/6a61e6d812b2cefb7fb529f62ab4c867ca80c1d7/platforms/core-runtime/launcher/src/main/java/org/gradle/launcher/daemon/configuration/DaemonParameters.java#L47

@aSemy
Copy link
Contributor

aSemy commented Jun 18, 2024

On GitHub CI Xmx is set to 12g - maybe we should reduce that to allow more memory for the tests?

GRADLE_OPTS: -Dorg.gradle.jvmargs="-Xmx12g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"

Also, I think that setting MaxMetaspaceSize is a bit out of fashion these days - setting Xmx should be enough, and then Java will pick a sensible default for MaxMetaspaceSize, as a percentage of Xmx.

@OliverO2
Copy link
Contributor Author

I did not check how the JVM would actually do allocations (grab configured limits from the OS instantly or increase up to configured limits). I also did not check what might be required. So I have no better insights than you on this topic. Would it be OK if you'd just adjust the setting as you see fit (as part of this PR or in a separate one)?

@aSemy
Copy link
Contributor

aSemy commented Jun 19, 2024

I was hoping you had more expertise 😅. I've pushed an update that I think should work better though, so let's see...

aSemy and others added 2 commits June 19, 2024 07:46
@OliverO2 OliverO2 merged commit e2ebd49 into master Jun 21, 2024
@OliverO2 OliverO2 deleted the oo2/test-task-configuration branch June 21, 2024 14:24
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.

CI: test_linux(jvmTest) fails intermittently with OutOfMemoryError: Java heap space
2 participants