[GHC] #9332: Memory blowing up for strict sum/strict foldl in ghci

GHC ghc-devs at haskell.org
Mon Jul 21 07:32:21 UTC 2014


#9332: Memory blowing up for strict sum/strict foldl in ghci
-------------------------------------+-------------------------------------
              Reporter:              |             Owner:
  artella.coding                     |            Status:  closed
                  Type:  bug         |         Milestone:  7.8.4
              Priority:  high        |           Version:  7.8.3
             Component:  GHCi        |          Keywords:  ghci, strict,
            Resolution:  fixed       |  memory
Differential Revisions:              |  Operating System:  Linux
          Architecture:  x86_64      |   Type of failure:  Runtime
  (amd64)                            |  performance bug
            Difficulty:  Unknown     |         Test Case:
            Blocked By:              |          Blocking:
       Related Tickets:              |
-------------------------------------+-------------------------------------

Comment (by simonpj):

 There is a difficult tension here, described in Chapter 23 of my
 [http://research.microsoft.com/en-us/um/people/simonpj/papers/slpj-
 book-1987/index.htm 1987 book], namely the tension between sharing
 computation and saving space.  I do not know of any comprehensive answer.

 The problem tends to bite less when (as is commonly the case) numbers like
 `1000000` don't appear in your program but rather are computed from the
 input or the command line flags.  But it's still definitely a problem
 (e.g. with `[1..]`.)

 A possible solution might be to revert any CAFs that are retaining a great
 deal of space, by turning them back into their un-computed form.  (Of
 course, their uncomputed form might retain a great deal of space too!)

 Simon

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


More information about the ghc-tickets mailing list