[GHC] #7702: Memory Leak in CoreM (CoreWriter)

GHC cvs-ghc at haskell.org
Fri Mar 8 23:10:46 CET 2013


#7702: Memory Leak in CoreM (CoreWriter)
-------------------------------------------+--------------------------------
  Reporter:  afarmer                       |          Owner:                  
      Type:  bug                           |         Status:  patch           
  Priority:  normal                        |      Milestone:                  
 Component:  Compiler                      |        Version:  7.6.2           
Resolution:                                |       Keywords:                  
        Os:  Unknown/Multiple              |   Architecture:  Unknown/Multiple
   Failure:  Compile-time performance bug  |     Difficulty:  Unknown         
  Testcase:                                |      Blockedby:                  
  Blocking:                                |        Related:                  
-------------------------------------------+--------------------------------

Comment(by afarmer):

 Both:

 {{{
     let w3 = w1 `plusWriter` w2
     return $ w3 `seq` (y, s'', w3)
 }}}

 and:

 {{{
     let w3 = w1 `plusWriter` w2
     liftIO $ evaluate w3
     return (y, s'', w3)
 }}}

 will fix the leak. I'm inclined to the former, as the latter requires
 adding an extra import for evaluate itself. Let me know which is
 preferable and I'll upload a new patch.

 Can the testsuite check for things like maximum residency? If so, I can
 also contribute a minimal test case to avoid future regressions.

 Edward: could you address the documentation that Simon mentioned? I admit
 I found this mostly with lots of trial and error, and feel like you may be
 better at explaining #5129 than me. ;-)

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



More information about the ghc-tickets mailing list