Large amount of open files after configuration phase of large build (>5000 projects) #26650
Labels
a:bug
has:reproducer
Indicates the issue has a confirmed reproducer
in:groovy-dsl
in:instrumentation
in:kotlin-dsl
Milestone
Current Behavior
In a monorepo with > 5000 projects, we are seeing a large number of files left open after the configuration phase (typically after an IDE sync). Mainly we see
cp_proj.jar
andproj.jar
files left open. This has become problematic for us, as many of the devlopers who work on this project are on MacOS, and seem to be hitting the same issue reported here: #26115.I used the file leak detector to capture all the open file descriptors after an IDE sync, and found ~9.4k
proj.jar
and ~9.5kcp_proj.jar
files left open. Below are the stack traces that is common for the majority of each of these files.Top 2 stack traces for
cp_proj.jar
Top 2 stack traces for
proj.jar
Expected Behavior
File descriptors should be eagerly closed as soon as they are no longer needed. I'm unsure why all these files are required to stay open. If it's for performance, maybe having a flag or method to close them based on a trigger would be something we can work with, as this is causing issues with developers unable to build and/or sync their projects on MacOS.
Context (optional)
No response
Steps to Reproduce
Attempt to run a task on a very large (>5k project) build.
Gradle version
8.3
Build scan URL (optional)
No response
Your Environment (optional)
OS: MacOS 14.0
RAM: 64GB
CPU: Apple M1 Max
The text was updated successfully, but these errors were encountered: