[Mono-devel-list] GC with Pixbufs

Chris Seaton chris at chrisseaton.com
Mon Mar 15 12:27:56 EST 2004


I have a program that generates thumbnails of images for web pages. 
Creating a thumbnail simply involves reading the file into a Pixbuf 
image, scaling it into a new Pixbuf and saving it.

Mono doesn't seem to ever GC these Pixbufs. They are only referenced 
from local variables in functions when the thumbnail is being created so 
I'm sure they're elligible for deallocation.

Mono consumes over a gigabyte of virtual memory after a few minutes of 
creating thumbnails. If I remove the thumbnail code Mono consumes about 
15 MB.

Relevant source file attatched. See the CreateThumbnail() method. At the 
moment I'm only using the GDK code (GDK is defined on the command line), 
so don't worry about the System.Drawing stuff.

I know it's inelegant, but can I force deallocation somehow? Or am I 
doing something wrong so that the GC can't deallocate?

Thanks,

Chris Seaton
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: Thumbnail.cs
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20040315/63a61a2e/attachment.pl 


More information about the Mono-devel-list mailing list