[Haskell-cafe] space leak when repeatedly calling Control.Monad.State.Strict.modify

Joey Hess joey at kitenet.net
Mon Jan 30 02:07:09 CET 2012


The attached test case quickly chews up hundreds of MB of memory.
If modified to call work' instead, it runs in constant space.

Somehow the value repeatedly read in from the file and stored in
the state is leaking. Can anyone help me understand why?

(ghc 7.0.4)

-- 
see shy jo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testcase.hs
Type: text/x-haskell
Size: 818 bytes
Desc: not available
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120129/73662425/attachment.hs>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120129/73662425/attachment.pgp>


More information about the Haskell-Cafe mailing list