|
Re: Space leak: msg#00157lang.haskell.glasgow.bugs
On Tue, Dec 27, 2005 at 08:12:20PM +0100, Christian Maeder wrote: > Already the following bit exhibits unexpected memory consumption: > > main = mapM_ print $ take (n * 5) $ drop (n * 3) [1..] > n = 100000 > > Dropping the elements is more expensive than printing them. Somehow the > dropped elements are kept in memory. I think it's the (succ (succ (succ ...))) thunk. When you change it to [1..99999999] there is no space leak - here every produced element must be examined before producing the next list node or []. Best regards Tomasz -- I am searching for a programmer who is good at least in some of [Haskell, ML, C++, Linux, FreeBSD, math] for work in Warsaw, Poland
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | GADTs and type synonyms, Ralf Hinze |
|---|---|
| Next by Date: | Signal inconsistency between GHC and GHCi, Sven Panne |
| Previous by Thread: | Space leak, Christian Maeder |
| Next by Thread: | Re: Space leak, Christian Maeder |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |