[Haskell-cafe] bizarre memory usage with data.binary
Stefan O'Rear
stefanor at cox.net
Tue Oct 2 19:27:04 EDT 2007
On Tue, Oct 02, 2007 at 04:08:01PM -0700, Anatoly Yakovenko wrote:
> i am getting some weird memory usage out of this program:
>
>
> module Main where
>
> import Data.Binary
> import Data.List(foldl')
>
>
> main = do
> let sum' = foldl' (+) 0
> let list::[Int] = decode $ encode $ ([1..] :: [Int])
> print $ sum' list
> print "done"
>
> it goes up to 500M and down to 17M on windows. Its build with ghc
> 6.6.1 with the latest data.binary
>
> Any ideas what could be causing the memory usage to jump around so much?
Only 500M? encode for lists is strict, I would have expected around
80GB usage... What does -ddump-simpl-stats say?
Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/haskell-cafe/attachments/20071002/91c71ac1/attachment.bin
More information about the Haskell-Cafe
mailing list