You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Moving go to the top level still causes memory leak
Using the parameter but irrelevantly with the conduit still causes memory leak (see below)
Replacing [(1 :: Integer)..] with iterate' succ (1 :: Integer) still causes memory leak
Calling go only once does not leak memory
Removing the paremeter altogether does not leak memory
Using the parameter as part of CC.yieldMany does not leak memory (see below)
Just evaluating the parameter but irrelevantly with the conduit still causes the memory leak:
-- Leaks memory, abortsmain::IO()
main =do
_ <- go ()
_ <- go ()pure()where
go x =doprint x
runConduit
$CC.yieldMany [(1::Integer)..]
.|CC.last
But using the parameter for CC.yieldManyprevents memory leak:
-- Doesn't leak memory, loops forevermain::IO()
main =dolet i =1::Integer
_ <- go i
_ <- go i
pure()where
go i = runConduit
$CC.yieldMany [i..]
.|CC.last
I have completely no idea what is going on. Please let me know if I misunderstand the evaluation strategy of Haskell.
The text was updated successfully, but these errors were encountered:
Troubleshooting my own program, I stumbled upon another instance of memory leak.
When you call twice a function which ignores its parameter, and the function runs a conduit, it leaks memory.
This is my minimized example:
The above program exits with "Heap exhausted;" after a while thanks to the rtsopts.
Here is what I observed so far:
CC.lastDef
but alsoCC.last
causes memory leak (unlike Functor instance causes memory leak when used with Shake #510)go
to the top level still causes memory leak[(1 :: Integer)..]
withiterate' succ (1 :: Integer)
still causes memory leakgo
only once does not leak memoryCC.yieldMany
does not leak memory (see below)Just evaluating the parameter but irrelevantly with the conduit still causes the memory leak:
But using the parameter for
CC.yieldMany
prevents memory leak:I have completely no idea what is going on. Please let me know if I misunderstand the evaluation strategy of Haskell.
The text was updated successfully, but these errors were encountered: