[Mono-devel-list] Embedding mcs into ASP.NET.

Ben Maurer bmaurer at ximian.com
Fri Apr 1 20:29:12 EST 2005

On Fri, 2005-04-01 at 19:16 -0500, Ben Maurer wrote:
> On Fri, 2005-04-01 at 13:42 +0200, Zoltan Varga wrote:
> > The memory management inside ref.emit is not very embedding friendly right
> > now, i.e. it is highly possible that there are memory leaks so memory usage will
> > probably increase with each compilation.
> Yeah, there are some fairly large leaks. The attached file will stress
> mcs on a specific compilation. you run:
> mono stress-mono.exe path/to/mcs.exe foo.cs
> After the path to mcs, you can put anything you want.

So I did a bit of profiling with this, both using valgrind and my
graphical heap profiler. In unmanaged land, it seems like there are
leaks in the resources of the MonoImage. Since the MonoDynamicImage is a
gc'd object, could a finalizer free up resources?

In managed land, the main issue is that we keep around the ILGenerator
from the method builder. Setting the ilgenerator to null will likely
solve the worst of the managed problems, as the gc will be able to clean
up after itself.

I tried a simple test on the Windows machine here, and they clearly leak
as well. I did not bother to test which runtime was leaking more, nor
did I look at the leaks on msft with the clrprofiler.

-- Ben

More information about the Mono-devel-list mailing list