Skip to content

Conversation

@anusreelakshmi934
Copy link
Contributor

@anusreelakshmi934 anusreelakshmi934 commented Oct 22, 2025

Fixes #1383

@anusreelakshmi934 anusreelakshmi934 marked this pull request as ready for review October 22, 2025 09:39
@anusreelakshmi934 anusreelakshmi934 marked this pull request as draft October 22, 2025 10:38
@anusreelakshmi934 anusreelakshmi934 changed the base branch from intellij-2025.3-support to main October 22, 2025 12:02
@anusreelakshmi934 anusreelakshmi934 marked this pull request as ready for review October 22, 2025 12:03
lclsVersion=2.3.2

# Increase Gradle memory to prevent OutOfMemoryError
org.gradle.jvmargs=-Xmx6g
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anusreelakshmi934 since this is just a properties file, do you know how this property actually gets pulled in to the environment where the build/tests are running? Typically, the properties listed in this file are referenced in build.gradle, but I don't see this one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also noticed this line in the build.gradle...

// Increase Java heap size to avoid OutOfMemoryError during compilation or tests.
// This setting addresses issues where the JVM runs out of memory, particularly during
// large builds or tests. The '2g' value specifies a maximum heap size of 2GB
// (-Xmx2g), which should be enough to prevent memory exhaustion in most cases.
options.forkOptions.memoryMaximumSize = "2g"
... which looks like it was supposed to address this kind of issue. Did you look into increasing this value at all?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed the options.forkOptions.memoryMaximumSize = "2g" setting, but from what I understand that only affects the forked Javac process. The OutOfMemoryError occurs in Gradle’s internals, meaning the daemon JVM is running out of memory. This fix is to increase the daemon heap via org.gradle.jvmargs to give it enough memory.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anusreelakshmi934 since this is just a properties file, do you know how this property actually gets pulled in to the environment where the build/tests are running? Typically, the properties listed in this file are referenced in build.gradle, but I don't see this one.

Gradle automatically reads gradle.properties and applies -Xmx6g to the Gradle daemon JVM. There's no need to reference it in build.gradle. The org.gradle.jvmargs property is special, Gradle picks it up from gradle.properties and uses it internally to configure the JVM for the Gradle daemon. As a result, any builds or tests executed through Gradle will automatically inherit this JVM argument. -
https://docs.gradle.org/current/userguide/config_gradle.html?utm_source=chatgpt.com#sec:configuring_jvm_memory

https://docs.gradle.org/current/userguide/build_environment.html?utm_source=chatgpt.com#gradle_properties_reference

Here I have just printed the info about the memory that is being used - https://github.com/anusreelakshmi934/liberty-tools-intellij/actions/runs/18771459676/job/53556716966#step:8:21

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.

Build failing on macOS runners due to low default Gradle memory

3 participants