[GHC] #15111: GHCi leaks the first modules loaded

GHC ghc-devs at haskell.org
Tue May 1 15:44:43 UTC 2018


#15111: GHCi leaks the first modules loaded
-------------------------------------+-------------------------------------
           Reporter:  simonmar       |             Owner:  (none)
               Type:  bug            |            Status:  new
           Priority:  normal         |         Milestone:  8.6.1
          Component:  Compiler       |           Version:  8.2.2
           Keywords:  ghci           |  Operating System:  Unknown/Multiple
       Architecture:                 |   Type of failure:  None/Unknown
  Unknown/Multiple                   |
          Test Case:                 |        Blocked By:
           Blocking:                 |   Related Tickets:
Differential Rev(s):                 |         Wiki Page:
-------------------------------------+-------------------------------------
 How to reproduce the leak:

 {{{
 cd nofib/real/veritas
 ghci +RTS -S
 Prelude> :load Main
 *Main> System.Mem.performGC
  10554832  32639712  38824584  0.048  0.058    2.317    8.386    0    0
 (Gen:  1)
 }}}

 Live data is ~38Mb (3rd number). Now unload everything:

 {{{
 *Main> :load
 Prelude> System.Mem.performGC
   4005376  32681280  38850224  0.013  0.048    2.330   29.896    0    0
 (Gen:  1)
 }}}

 Note the live data didn't go down.

 Load the program again:

 {{{
 Prelude> :load Main
 ...
 *Main> System.Mem.performGC
  16344112  47790304  54799632  0.070  0.074    4.343   82.235    0    0
 (Gen:  1)
 }}}

 Note the live memory is almost 2x what it was before.

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


More information about the ghc-tickets mailing list