Re: [gtk-list] Re: gdk_pixmap_create_from_xpm's and X memory

> De : Pavel Janik ml. <>
> A :
> Objet : [gtk-list] Re: gdk_pixmap_create_from_xpm's and X memory
> Date : vendredi 29 janvier 1999 12:10
>    From: James Bailie <>
>    Date: Thu, 28 Jan 1999 16:45:36 -0500
> Hi,
>    > The space for pixmaps is allocated by the X server, and is not
>    > when your program exits. You have to tell the X server to destroy the
>    > pixmap. It's a form of caching. You need to explicitly call
>    > gdk_pixmap_destroy, I believe, for every pixmap you created.

Hooo ... what a Microsoftish(tm) idea ... I'm not sure you're right ! I think
that as your program closes its connection to the X server, all resources
associated with it are freed (you can see that your the windows of your program
are closed, for example). However, the size of the X server executable won't
necessary shrink (it will only if the resources allocated by your program were
the last allocated). The 'free' space in the server will then be used for
storing pixmaps from other applications, or will be swapped to disk if unused.

You *don't* need to free the pixmap : Log in on an *idle* X server, then start
an image viewer like GQView to open an image of, say 1500*1500 pixels. Your X
server grows by 1500*1500*bpp bits. Kill the viewer (sorry for the author, but
...) so you're sure it won't XFree() its pixmaps. If the viewer was the last
process to allocate resources, your server will shrink.

Please correct me if I'm wrong.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]