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

GHC ghc-devs at haskell.org
Tue Apr 18 13:54:18 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:                    |
-------------------------------------+-------------------------------------
Description changed by MikolajKonarski:

@@ -27,0 +27,5 @@
+
+ Edit2: which actually doesn't prove the `--make` leak is a regression.
+ There may just be some other regression that makes the difference between
+ interrupted and non-interrupted compilation under 7.10.3 much smaller and
+ harder to measure.

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

 Edit2: which actually doesn't prove the `--make` leak is a regression.
 There may just be some other regression that makes the difference between
 interrupted and non-interrupted compilation under 7.10.3 much smaller and
 harder to measure.

--

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


More information about the ghc-tickets mailing list