[Mono-dev] Re: Mono.Cairo Memory Leak

Robert Jordan robertj at gmx.net
Thu Oct 6 04:51:09 EDT 2005


Manuel,

> I'm writing an interactive canvas for the MonoUML Case Tool. I'm using
> Cairo with Gtk# and I have experimented an ascending memory
> consumption when drawings are continuously performed, for example
> inside a MotionNotifyEvent Handler. This memory is never released and
> eventually SWAP memory is needed making all too slow.
> 
> I attach a simple example that illustrate this problem. Cairo draws a
> rectangle inside a Gtk.DrawingArea every time that the mouse is moved
> over the DrawingArea. Compile it, run it, move the mouse, and see how
> memory consumption starts to getting higher and higher over time.
> 
> Is anything wrong with my code? or is a bug?

You're not calling g.Dispose () or ((IDisposable)g).Dispose ();
when you're ready with the object.

Rob




More information about the Mono-devel-list mailing list