[GHC] #9520: Running an action twice uses much more memory than running it once

GHC ghc-devs at haskell.org
Fri Aug 19 12:57:49 UTC 2016


#9520: Running an action twice uses much more memory than running it once
-------------------------------------+-------------------------------------
        Reporter:  snoyberg          |                Owner:
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  Compiler          |              Version:  7.8.3
      Resolution:                    |             Keywords:
Operating System:  Linux             |         Architecture:  x86_64
 Type of failure:  Runtime           |  (amd64)
  performance bug                    |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by edsko):

 As Andres points out, my version 3 is not particularly enlightening;
 without any optimization, the loop in `feed` is not tail recursive (this
 relies on unfolding of `>>`); with optimization, we are bitten by the full
 laziness problem again. Bit of a red herring. (I had been trying to
 simulate the `hIsEOF` in the original example.)

 So I guess the only take away from my experimentation is: CAFs/full
 laziness and profiling modes interact in ways that make memory behaviour
 very unpredictable. Proceed with caution.

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


More information about the ghc-tickets mailing list