forked from moby/buildkit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* dagger fix: avoid leaking whole state/job with session.Group Passing solver.state around as a session.Group results in the solver.state being stored in cache refs, which makes cache ref memory leaks significantly worse. Signed-off-by: Erik Sipsma <erik@sipsma.dev> * rm SetFinalizer usage as it makes memory unfreeable Based on testing, each of the three usages of SetFinalizer in buildkit are broken in that they make the memory unfreeable. Most likely this is somehow related to cyclic data structures, but SetFinalizer is very tricky to use correctly so could be something else. Either way, you can empirically see their usage results in unfreeable memory by looking at the heap.alloc.garbage metric when running `viewcore breakdown`. That metric indicates memory in the heap that's not referenced but has not been released. With the SetFinalizers in place, the garbage accumulates to over a GB when running TestModule for a few mins. It never goes down even with manual GC triggers and GOMEMLIMIT settings that force the GC to free as much memory as it can. Removing any one of the SetFinalizers reduces that garbage metric by a few hundred MBs, but removing all of them reduces it down to negligible levels. Signed-off-by: Erik Sipsma <erik@sipsma.dev> --------- Signed-off-by: Erik Sipsma <erik@sipsma.dev>
- Loading branch information
Showing
4 changed files
with
35 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters