New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increased memory usage (with -p option) #22688
Comments
Sorry that you're having trouble with Gradle! Your issue lacks information about how to reproduce the problem you're having. A reproducer project can really help us track down and fix your problem quicker. We may also be able to suggest workarounds or ways to avoid the problem if we can reproduce it. You can use the following as a base for your reproducer: https://github.com/gradle/gradle-issue-reproducer This issue will be closed after 7 days, unless you can provide more information. The current steps to reproduce don't reproduce it for us and it seems more like a memory setting problem, so pls. check those. |
Indeed I tried it on another machine and it worked. Will re-open it if I can reproduce it again with the template. |
Sorry, actually I tested it in the wrong branch. I'm still able to reproduce it in my project. It might be a problem with big multi-project modules (~80 subprojects). Do you have one to test it on? I can't share my project, and the reproducer isn't big enough. This is a blocker for us.
I can share the pictures of the heap dump on error, to see if it helps: |
Ok, I was able to reproduce it with 7.5.1. The regression label can be taken off. I'll leave it open in case the screenshots help to figure out the problem. |
I renamed the issue to remove the link with 7.6 RCs |
Thank you for providing a valid reproducer. The issue is in the backlog of the relevant team but the existence of a workaround makes it non-critical so it might take a while before a fix is made. Workaround is to increase the memory given to Gradle. |
In my project I increased it from 4g to 8g, and it wasn't enough. |
Thank you for the provided information. Another thing to try would be to use this Gradle version which contains an attempt at reducing memory usage:
|
Thanks for trying @eskatos. I tried again with that build and I reproduced it again. I'm attaching some reports: To see if I can help with these details:
|
Thanks @tomasAlabes. Still hard to reproduce with just the above instructions. Please provide a complete reproducer |
I don't think I will be able to give you the reproducer, it's a pretty big project. If you don't have one in your suite, then you can close this or leave it open in case someone can. I will have to go back to the colon syntax to make it work. Although it's annoying because the commands become larger ./gradlew -p myProject/ clean build -x test -x check
# vs
./gradlew :myProject:clean :myProject:build -x :myProject:test -x :myProject:check |
Slightly off topic, but you could have a much shorter command altogether. And if it does not, consider adding a lifecycle task (a task without an action) that does what you need and nothing more. Excluding tasks is not a recommended practice in Gradle. |
I'm seeing similar symptoms with a large multiproject build after upgrading from 7.5.1 to 7.6. Attaching a profiling shows a huge increase in instances of |
I am also seeing this in very large multiproject builds (~50 subprojects). In |
Came here to say the same thing as @mikethecalamity pointed out. In my case, it hits the OOM through the Gradle plugin for IntelliJ. If any changes are made to the project the IDE asks to reload the project to rebuild the structure. With the extended JVM args in
it used to work on Gradle 7.4.2 / 7.5.1, but crashes constanly on Gradle 7.6.0.
Note: stretching out the heap size to 3GB helps to bring it back to work. But, it would be nice to have constant memory utilization across the builds. |
Could some of the reporters here try |
Tried with my project and still getting to "Expiring Daemon because JVM heap space is exhausted" and dying.
…------- Original Message -------
On Wednesday, January 18th, 2023 at 2:12 AM, Sterling Greene ***@***.***> wrote:
Could some of the reporters here try 7.6.1-branch-sg_761_reduce_memory_consumption-20230118002823+0000? This is a nightly build based off a branch. If this looks better, I'll get it merged for 7.6.1
—
Reply to this email directly, [view it on GitHub](#22688 (comment)), or [unsubscribe](https://github.com/notifications/unsubscribe-auth/AAFKYKA7NTYP6VXKTXD6JFLWS47RNANCNFSM6AAAAAAR5VDQGM).
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
@big-guy, thank you for looking at this! In my tests, the night build looks very promising. Here is a quick summary of the durations it took to rebuild the structure:
|
@AlanMasciangelo @mikethecalamity @tomasAlabes Could you give |
@big-guy, do you know if these memory optimizations made it into 8.0? |
A number of improvements have been released in Gradle 8 and will be part of an upcoming Gradle 7.6.1 release. Closing as resolved for now. |
@big-guy @ljacomet I tried running with In the example below, we have 85 total projects and 36 of those are Quarkus services using
You'll note that even in |
@mikethecalamity Could you try 8.2-milestone-1? There are further improvements in there. |
@ljacomet It worked with Do you know when |
Expected Behavior
We should be able to build a project in the multimodule project by specifying the
-p <project>
option.Current Behavior
This isn't reproducible with Gradle 7.5.1, only with 7.6:Using gradle's sample project and updating gradle with:
Context
In my own project, I can't do this either. I stopped all Gradle daemons, but it didn't help. I created a similar bug for 7.6, maybe it is related: #21708
Steps to Reproduce
Download gradle's sample project: https://docs.gradle.org/current/samples/zips/sample_structuring_software_projects-kotlin-dsl.zip
And run
./gradlew wrapper --gradle-version=7.6-rc-2 && ./gradlew -p server-application/ build
Your Environment
Gradle: 7.6-rc2
Kotlin: 1.6.21 / 1.7.10
OS: MacOS Monterey 12.5 (M1 Pro)
The text was updated successfully, but these errors were encountered: