-
Notifications
You must be signed in to change notification settings - Fork 711
cabal uses too much memory when solving for setup dependencies #2899
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
Comments
The solver creates linked nodes by copying existing unlinked nodes. Previously, the subtrees shared data, which caused a space leak. This commit gives the subtrees dummy arguments to prevent sharing.
I encountered this issue again while testing with a long-running command: The -v3 log shows that the solver chose to link a setup dependency near the top of the tree (level 8). It didn't return to that level until around the time that the memory usage dropped. When it descended again, it used a different goal order and chose the setup dependencies much farther down in the tree. I think that the spike in memory usage can be explained by the solver retaining the whole subtree starting where it chose the first setup dependency. |
It uses a lot of memory but doesn't fail.
The solver creates linked nodes by copying existing unlinked nodes. Previously, the subtrees shared data, which caused a space leak. This commit combines the "build" and "addLinking" tree traversals so that the nodes are copied before they are expanded into full trees.
The solver creates linked nodes by copying existing unlinked nodes. Previously, the subtrees shared data, which caused a space leak. This commit combines the "build" and "addLinking" tree traversals so that the nodes are copied before they are expanded into full trees.
The solver creates linked nodes by copying existing unlinked nodes. Previously, the subtrees shared data, which caused a space leak. This commit combines the "build" and "addLinking" tree traversals so that the nodes are copied before they are expanded into full trees.
The solver creates linked nodes by copying existing unlinked nodes. Previously, the subtrees shared data, which caused a space leak. This commit combines the "build" and "addLinking" tree traversals so that the nodes are copied before they are expanded into full trees.
Solver: Fix space leak in 'addlinking' (issue #2899).
Fixed in #4110. |
Some combinations of setup and library dependencies cause the solver to use more and more memory. I ran
cabal install --dry-run --max-backjumps -1
with this cabal file for five minutes with about 16GB of memory. I used GHC 7.10.2.My best guess is that it is related to the
addLinking
function creating linked nodes from existing unlinked nodes. When a node is referenced by a later sibling, it probably isn't garbage collected immediately after it is traversed.cabal/cabal-install/Distribution/Client/Dependency/Modular/Linking.hs
Line 67 in c5b90c4
The text was updated successfully, but these errors were encountered: