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

GHC ghc-devs at haskell.org
Wed Jun 13 19:34:27 UTC 2018


#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 #13564     |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by MikolajKonarski):

 Just one more data point, showing (I guess) how big .hi files loaded into
 memory and never freed can lock up lots of RAM during compilation: this
 commit

 https://github.com/LambdaHack/LambdaHack/commit/9adc5ee93ab32a9a1ba949362371a6a28abf446a

 lowers maximum resident set size of GHC during compilation from 4.5G to
 2.8G, as measured with `/usr/bin/time -v cabal build -j1`on Ubuntu with
 GHC 8.4.3. As reported in other comments, it's also the case that
 interrupting the compilation and then restarting it lowers resident set
 size considerably.

 Before the commit, two RAM usage peaks coincide when compiling the library
 section of the .cabal file --- one peak from 120 large .hi files loaded
 into memory (I guess ~2G) and another from an excessive amount of
 specialisations performed when compiling a single module that provides a
 concrete implementation of a certain monad. The commit just moves the
 specialization to executable section of the .cabal file thus separating
 the peaks.

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


More information about the ghc-tickets mailing list