Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@snazy
Copy link

@snazy snazy commented Dec 20, 2025

Changes

This change introduces a hard-coded heap size for the Gradle daemon used when updating the Gradle wrapper and updating the Gradle dependency lockfile(s).

The heap size is limited to 256m for Gradle wrapper updates and 768m for dependency lockfile(s). The higher value for the latter is to give more complex builds a chance to execute. The wrapper update is pretty simple and doesn't need that much heap.

Also ensured that the Gradle daemon terminates early by adding a --no-daemon for the wrapper-update.

Similar for the dependency lockfile(s) added a --stop to terminate running daemons, but allow the daemon to stay around and speed up the multiple Gradle invocations.

Context

Please select one of the following:

AI assistance disclosure

Did you use AI tools to create any part of this pull request?

Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.

  • No — I did not use AI for this contribution.
  • Yes — minimal assistance (e.g., IDE autocomplete, small code completions, grammar fixes).
  • Yes — substantive assistance (AI-generated non‑trivial portions of code, tests, or documentation).
  • Yes — other (please describe):

Documentation (please check one with an [x])

  • I have updated the documentation, or
  • No documentation update is required

How I've tested my work (please select one)

I have verified these changes via:

  • Code inspection only, or
  • Newly added/modified unit tests, or
  • No unit tests, but ran on a real repository, or
  • Both unit tests + ran on a real repository

The public repository:

@snazy snazy changed the title Gradle: Limit Gradle daemon heap size fix(Gradle): Limit Gradle daemon heap size Dec 20, 2025
@snazy
Copy link
Author

snazy commented Dec 20, 2025

@jamietanna I figured out that the dependency-lockfiles part could run into the same issue, so I went ahead and added a (bigger) heap limit for it as well. I wouldn't expect projects using that feature to run into issues with the change, but if you think we should separate the change, let me know.

@snazy snazy force-pushed the gradle-heap-oom branch 8 times, most recently from b156363 to 3146bed Compare December 20, 2025 18:15
This change introduces a hard-coded heap size for the Gradle daemon used when updating the Gradle wrapper and updating the Gradle dependency lockfile(s).

The heap size is limited to 256m for Gradle wrapper updates and 768m for dependency lockfile(s). The higher value for the latter is to give more complex builds a chance to execute. The wrapper update is pretty simple and doesn't need that much heap.

Also ensured that the Gradle daemon terminates early by adding a `--no-daemon` for the wrapper-update.

Similar for the dependency lockfile(s) added a `--stop` to terminate running daemons, but allow the daemon to stay around and speed up the multiple Gradle invocations.

Fixes renovatebot#39558
Copy link
Contributor

@jamietanna jamietanna left a comment

Choose a reason for hiding this comment

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

Thanks! Couple of things:

  • Adding the --stop and --no-daemon would be great as separate changes (i.e. new PR), so they can be released + tested independently, as they should be safe to handle on their own
  • Via #39558 we should make this configurable, at least for Global config, so it's not defaulted (and i.e. to allow Mend Renovate Enterprise Cloud users to have increased memory allocated, if they wish)
  • In the future, we can look at adding repo-level config to tune this

Thanks!

Copy link
Collaborator

@RahulGautamSingh RahulGautamSingh left a comment

Choose a reason for hiding this comment

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

+1 for making it configurable (at global level)

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.

feat(gradle-wrapper): set JVM limits when updating wrapper

3 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.