[Mono-list] Memory leak
Paolo Molaro
lupus at ximian.com
Mon Feb 2 13:05:50 EST 2009
On 02/01/09 Jon Harrop wrote:
> This code creates a queue represented by a cyclic list and repeatedly adds and
> takes one element at a time (so there are always either 1 or 2 elements in
> the queue). Running on Mono 2.2, this program leaks, consuming all 4Gb of my
> memory in only 60 seconds.
If your description of the code is correct, it shouldn't "leak" even with
the Boehm GC. Write the equivalent code in C#, for example. My guess is
that either your code doesn't do what you describe or there is a bug
triggered by F# in the runtime and what is actually leaking is not
managed memory. Post the equivalent C# code and we can easily check
which case it is.
> I understand that Mono's new garbage collector has been delayed until Mono 2.9
> but someone else mentioned that even this new GC will still not be accurate
> and, therefore, is likely to leak memory indefinitely as well. Is that
> correct?
There are various degrees of GC precisions: the current GC is already
precise wrt heap objects and basically only thread stacks are scanned
conservatively. The new GC does the same (though there are
a few more little-used memory locations that are scanned precisely).
Precise scanning of the managed stack frames is planned for a subsequent
release (it requires JIT changes as well).
lupus
--
-----------------------------------------------------------------
lupus at debian.org debian/rules
lupus at ximian.com Monkeys do it better
More information about the Mono-list
mailing list