-
Notifications
You must be signed in to change notification settings - Fork 711
Memory leaks in cabal install #2546
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
@gibiansky Can you capture one of the error messages? It would also help if you could reproduce with a profiled build. If you aren't sure how to do that, I can provide instructions. I will try to reproduce here. BTW, what GHC version are you using? I have heard reports of increased memory usage with GHC 7.10. In any case, the profiled build will confirm that it's cabal and not GHC leaking memory. |
I see this at least on GHC 7.8 with Cabal 1.18. Error messages are uninformative and look like this:
Because the OS just kills the cabal process for using too much memory (and when it's restarted and has to build less packages, it works fine). Another time I've seen it on 7.10 with Cabal 1.22, this time with a better error message:
So I don't think this is a regression. How do I use a profiled build? (I assume a profiled build of If you want to see the details of the builds that occasionally cause this, look at my Travis CI configuration which installs GHC, cabal, and all the packages I need. The step that fails is |
This could be GHC itself using too much memory and not Cabal. |
One hypothesis is that you're running too many parallel GHC processes. Try limiting parallelism with |
Trying it with |
Yes. It should be sufficient to run, with
or, with
If you want to avoid modifying the user package database, you can do
prior to running one of the above commands. This will install cabal-install in the sandbox, so you will need to run |
I tried to replicate this myself with a profiling build of cabal-install. The maximum residency of cabal-install is 95 MB, which is reasonable for the number of packages being installed. On the other hand, GHC uses significantly more memory, upwards of 1 GB, probably more than Travis allows. I am closing this issue, as it appears to be GHC's problem. |
Summary: The Travis build fails. Trying haskell/cabal#2546 to see if that helps. Reviewed By: niteria Differential Revision: D5612089 fbshipit-source-id: d4df127
I have a Travis CI setup that installs
Ihaskell
along with all of its dependencies. Travis boxes have fairly limited memory, and so thecabal install
regularly fails at least 1-2 times due to out of memory errors (I am 90% sure that's what they are), before finally succeeding on the 3rd try (or sometimes even failing then).This sounds like a memory leak to me: if by restarting the program I use less memory, then it seems like the memory could be recycled anyways. I've encountered this many times when working with
cabal
, and usually it's not a big deal – just rerun the cabal install and it'll work.However it does seem a bit strange. Has anyone investigated this? Is this a well-known issue (is this a dupe? I searched in the issues list but couldn't find anything)? Is there any way I can contribute to fixing it without really knowing
cabal
source?The text was updated successfully, but these errors were encountered: