[Mono-list] PIxbuf loading optimization

Salvatore Scarciglia s.scarciglia at hyperphar.com
Tue Feb 21 02:14:45 EST 2006

Hi Anset,
first of all: thanx very much for your hint! It works fine and now my
application run fast during treeview filling. In the Monodoc I found the
following description for the method Gtk.Main.Iteration();

"Runs an iteration of the main loop: blocks until an event is received"

I think that Monodoc is not so complete. So I will search more information on
the Web. 

Kind regards,

On Mon, 20 Feb 2006 17:30:09 +0100
Anset <Anset at anset.org> wrote:

> Hi,
> In my application, I needed to load a number of pixbufs from file and I 
> found that if I loaded more that 10 pixbufs, all the memmory on my 
> system would fill up and all that happened was endless swapping.
> I was able to solve this by inserting
> 	while (Gtk.Global.EventsPending) Gtk.Main.Iteration();
> after every pixbuf is handled and added to the Store.
> It would appear that this way some buffers are cleared(?), freeing up 
> the used up memmory, avoiding the swapping and my app ran very much faster.
> I am not using threads but maybe this helps you too.
> Wkr,
> Anset.
> Salvatore Scarciglia wrote:
> > Hi all,
> > I'm developing a small image viewer in mono (mono+glade+monodevelop); my app
> > works fine but pixbuf loading. I want to read the content of a folder in the
> > filesystem and, for each image found inside current folder, create a small
> > thumb in a TreeView with a CellRendererPixBuf and other information about
> > image. When the folder contain small images, the loading of its content is
> > fast; but if I try to "browse" a folder containing a lot of wallpaper
> > (1024x768 images, up to 300kb each one) the application freeze. I've to
> > wait a few minutes before using the app again. 
> > I'm using Thread to load the image into a pixbuf object, so the first image
> > you see in the treeview is a small image, replaced at runtime by the
> > original picture when the Thread has finished loading it. 
> > 
> > Any suggestion ?
> > 
> > Thanx
> > 
> > 
> > Salvatore ---------------------<|
> > LAAS --------------------------<|
> > http://laas.altervista.org ----<|
> > _______________________________________________
> > Mono-list maillist  -  Mono-list at lists.ximian.com
> > http://lists.ximian.com/mailman/listinfo/mono-list
> > 

More information about the Mono-list mailing list