La plume l�g�re, � Fri, Nov 03, 2000 at 10:19:59AM -0500, heure d'inpiration,
[EMAIL PROTECTED] �crivait en ces mots:
> First off, this is *NOT* a gdk bug, because the server:
> a) doesn't *know* the client is gdk
So what? If there is some X "policy" to not release resources without
explicit destruction, the programmer has to destroy the resources he created.
The fact that it is stupid is another thing. Now there are a lot of
stupid design problems with X...
For what GDK is concerned, I love that library because it permits to forget
about X trickiness. And maybe this is one more thing that could be implemented.
So if it's not a bug, it's a non-feature ;-)
> b) should be bullet-proof against anything the client does.
Same thing here. X sucks...
> Is memory actually *leaking* from the X server, or is storage being
> *fragmented*? There's a big distinction here, and the fix is different
> for each case.
I don't think there is a way to know it except by profiling the memory
usage of the server, which I don't have the time to do.
Something I am sure of is, now that I am using
gdk_set_back_pixmap (drawable, NULL, TRUE) the "leak" has diminished from 5Mb
down to a couple of Kb (~50). I would deduce that the 5Mb was due to a
leak and that the 50Kb are due to fragmentation.
> Unfortunately, C does not have any good garbage-collection scheme for compacting
> the allocated memory - the problem is that the garbage collector has no way
> of knowing what variables in the program have pointers to the to-be-moved
> allocation, so it can't relocate allocated memory.
Well, a GC would certainly be possible to implement. Emacs has its own GC,
GNU ObjC can be "garbaged-collected" while it's written in C. Everything in C
which is not related to basic bit/byte manipulation, basic computation and
basic memory management has to be brought artificially, contrarily to higher-level
languages. C is just a portable assembler.
Wolfgang
--
A chicken is an egg's way of producing more eggs.
_______________________________________________
gtk-list mailing list
[EMAIL PROTECTED]
http://mail.gnome.org/mailman/listinfo/gtk-list