Delivered-To: lablgtk at yquem.inria.fr From: Jon Harrop Organization: Flying Frog Consultancy Ltd. To: lablgtk at yquem.inria.fr Subject: Re: [Lablgtk] Leaking pixmaps Date: Wed, 9 Jan 2008 12:54:45 +0000 References: <200801091053.51621.jon at ffconsultancy.com> <20080109.215209.2004159811.garrigue@math.nagoya-u.ac.jp> In-Reply-To: <20080109.215209.2004159811.garrigue at math.nagoya-u.ac.jp> MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200801091254.46023.jon at ffconsultancy.com> Content-Type: text/plain; charset="iso-8859-1" Content-Length: 1395 On Wednesday 09 January 2008 12:52:09 Jacques GARRIGUE wrote: > From: Jon Harrop > > > Has anyone found a bug where using pixmaps causes a memory leak resulting > > in X consuming all memory and dying? > > > > I just ditched pixmaps in favour of direct rendering which fixed the > > problem and the symptom deterred me from investigating... > > This is not a bug, but the normal behaviour since pixmap are on the > server side, and it would be complicated to manage them properly. > This is the reason there is a Gdk.Pixmap.destroy function, so that you > can destroy pixmaps early when you don't need them anymore. > examples/timer.ml shows how to use it. When using OpenGL from OCaml, I wrapped handles to external resources like display lists and textures in objects and finalized them so OCaml's GC collected the external resource. That worked extremely well but partly because OpenGL does not leak resources after application death as X seems to. Perhaps a similar scheme could be useful here? Also, I've managed to reproduce the problem without pixmaps. The leak seems to be with colors now. Can I deallocate a color? -- Dr Jon D Harrop, Flying Frog Consultancy Ltd. http://www.ffconsultancy.com/products/?e _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk