[Haskell-cafe] Re: space leak with 'concat' ?

Peter Verswyvelen bugfact at gmail.com
Sat Feb 14 12:18:02 EST 2009

it was on MS.NET 3.5
now the problem was the following

the problematic object encapsulated a running timer. on each tick of the
timer, I added an occurrence to a stream

this stream was used in another thread, but the stream itself had no
backpointer to the object that generated it

so the object that encapsulated the running timer got collected since no
pointer existed to it... and no occurrences in the stream got generated

If the GC would consider timers as roots, then this would not be a problem I

Do you think this is something to report as a bug to Microsoft?

But this is a bit off topic in Haskell Cafe :-)

On Thu, Feb 12, 2009 at 11:52 AM, Felipe Lessa <felipe.lessa at gmail.com>wrote:

> 2009/2/12 Peter Verswyvelen <bugfact at gmail.com>:
> > It is funny that recently I had a strange problem in C# (I tried to write
> > parts of Reactive in C#) where the garbage collector freed data that was
> > actually needed by my program! I had to fix that by putting a local
> variable
> > on the stack, passing the constructed data to a function did not work. I
> > think .NET and Java the garbage collector traverses from data (the stack,
> > globals, etc). If I understood Simon correctly, GHC traverse the code
> blocks
> > instead, which feels correct as it would have fixed the bug I had in C#.
> So
> > yet again an extreme difference between Haskell and .NET/Java even when
> it
> > comes to garbage collection, Haskell wins :)
> I'm curious, a GC that removes live data is a buggy GC. What was
> holding the pointer to the data, if it was not the stack? Were you
> with MS .NET or with Mono?
> --
> Felipe.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090214/56d3b415/attachment.htm

More information about the Haskell-Cafe mailing list