-
Notifications
You must be signed in to change notification settings - Fork 460
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
Gradle spotless plugin using large amounts of ungcable heap in daemon when using 'ratchetFrom' #735
Comments
Hm. Thanks for info. It should be the case that the resources are closed when the build finishes: spotless/plugin-gradle/src/main/java/com/diffplug/gradle/spotless/RegisterDependenciesTask.java Lines 94 to 100 in 5d965e7
spotless/lib-extra/src/main/java/com/diffplug/spotless/extra/GitRatchet.java Lines 255 to 260 in 5d965e7
Perhaps that |
Hello, I don't think it is this. I compiled spotless for myself with your proposed change and same result. I did some small amount of debugging, during configuration a different Repository object is instantiated for each project, and then we have 4gb of heap used. But we just have the one repo, so this seems like the issue to me? I deleted this line (since this logic seems to be pertaining to multiple repos forming one gradle projects, not the case for me)
And everything seemed to still work, and now the heap was the normal size. Sorry if I'm way off base, and please let me know if there's anything I can run for you to see if it works for me. |
Ruh-roh!
I think you are right, but I think the recursion in The tricky part of this code is handling submodules, where a single gradle build may have multiple git repositories within it. I think what the code is trying to do is:
The one weak spot of the model described above is a setup like this (note the GAP)
I think the line that you deleted is meant to handle the GAP case, but it accidentally creates too many repositories. Perhaps this condition needs to move up into the spotless/lib-extra/src/main/java/com/diffplug/spotless/extra/GitRatchet.java Lines 178 to 180 in 5d965e7
PR's wanted! |
I believe fixed in |
Bump |
Sorry! I hadn't seen this, have now confirmed it fixed. Thank you very much. |
In my project, if I use the ratchetFrom argument when using spotless then the gradle daemon requires 4GB more heap than without it. The size of the repo on git is 130MB. Heap analysis shows the 4GB to not be able to get collected.
I am using gradle 6.6.1, my plugin version is 5.6.1.
My OS is Windows, but this occurs on Linux also.
Sorry I can't link the repo, it is private. It is a large multi module Scala project using gradle as the build tool, we apply the spotless plugin to most of the modules, the spotless configuration looks something like so (some fields redacted)
No errors are emitted when running.
Sorry I have not been able to artificially replicate the problem, it does not seem to be related to the size of the repo.
The text was updated successfully, but these errors were encountered: