[Haskell-cafe] GHC, odd concurrency space leak

Daniel Fischer daniel.is.fischer at web.de
Wed Apr 14 18:01:55 EDT 2010


Am Mittwoch 14 April 2010 23:13:13 schrieb Gregory Collins:
> Jesper Louis Andersen <jesper.louis.andersen at gmail.com> writes:
> > This post describes some odd behaviour I have seen in GHC 6.12.1 when
> > writing Combinatorrent. The post is literate Haskell so you can run
> > it. The executive summary: A space leak occurs when a new process is
> > spawned from inside another process - and I can't figure out why. I am
> > asking for help on haskell-cafe.
> >
> > ...[snip]...
> >
> >> import Control.Monad.State
>
> Does the problem go away if you use "Control.Monad.State.Strict"?

No. The problem goes away, however, if I replace p1 with

p1 = forever $ liftIO (return () >> threadDelay 0)

It is reduced, but still present, for

p1 = forever $ liftIO (return () >> yield)

It is also reduced by decreasing the delay in p2.
I don't know what's going on, though.


More information about the Haskell-Cafe mailing list