[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
Re: Xserver growing ??
- From: Allan Black <allan genia scotnet co uk>
- To: gtk-app-devel-list redhat com
- Subject: Re: Xserver growing ??
- Date: Thu, 17 Feb 2000 11:16:27 +0000 (GMT)
> Well, I figured that out myself. Usually if you call malloc() the memory usage
> of your program grows, but here, the Xserver grows... Thats what I don't
> understand ...
It's not 'memory leaks' as such, what you are probably doing is, allocating
X resources, e.g. GCs, pixmaps (especially large pixmaps!) or windows.
These resources are managed by the server - pixmaps, for example, are held
in the server, and that includes a copy of the image.
So, I guess you're allocating server resources which you are not freeing.
Once your connection to the X server is closed down, the server releases
the resources associated with the connection.
One common problem is: you have a section of code which needs a pixmap, so
you create the pixmap at the beginning of it's invocation. This way you
allocate a pixmap every time this bit of code is called. Either you need to
free the pixmap at the end of it, or create the pixmap *once* and re-use it.
Allan
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]