[GHC] #13586: ghc --make seems to leak memory

GHC ghc-devs at haskell.org
Tue Apr 18 13:48:25 UTC 2017


#13586: ghc --make seems to leak memory
-------------------------------------+-------------------------------------
        Reporter:  MikolajKonarski   |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  8.0.1
      Resolution:                    |             Keywords:
Operating System:  Linux             |         Architecture:  x86_64
 Type of failure:  Compile-time      |  (amd64)
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:  #13379            |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

@@ -24,0 +24,3 @@
+
+ Edit: this is a regression, GHC 7.10.3 uses < 3G for compilation without
+ even interrupting

New description:

 (This is probably not reproducible with a small example.) When I build
 this project with `cabal build`

 https://github.com/LambdaHack/LambdaHack/commit/138123ab13edd4db6c8143720af68b6ec4a1726e

 the peek memory, as observed with `top`, is 10G*. When I instead interrupt
 the compilation with `^C` at the following point (compilation of this file
 take a couple of minutes, so it's easy to interrupt):

 {{{
 [123 of 123] Compiling
 Game.LambdaHack.SampleImplementation.SampleMonadServer (
 Game/LambdaHack/SampleImplementation/SampleMonadServer.hs,
 dist/build/Game/LambdaHack/SampleImplementation/SampleMonadServer.o )
 }}}

 and then restart and continue to the end, peek memory usage in either of
 the two compilation parts is 5G*. So it seems `ghc --make` keeps some data
 that is either eventually not used or could as well be read on demand
 instead of kept in memory. Confirmed with 8.2.1-rc1 as well, but it's not
 trivial to compile due to restrictive upper bounds of many packages.

 *exact numerical values are made up

 Edit: this is a regression, GHC 7.10.3 uses < 3G for compilation without
 even interrupting

--

Comment (by MikolajKonarski):

 Jan, that was a great hunch --- indeed, this is a regression, GHC 7.10.3
 uses < 3G for compilation without even interrupting. It's possible,
 different versions of some packages I use under 7.10.3 may contribute, but
 I'd be surprised if it wasn't almost completely the change of GHC version.

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/13586#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list