[gtkada] Garbage collection issues?

Bobby D. Bryant bdbryant at mail.utexas.edu
Tue Feb 29 01:37:45 CET 2000


Here is a cluster of observations and questions about memory management
while using GtkAda.  Any tips, including reading references, will be
appreciated.

Some of the example programs shipping with GtkAda use a single variable
to catch the handles of multiple widgets as they are created, with the
result that the program afterward only has direct access to the last one
in the sequence.  Is that strategy suitable for a large program that may
run for hours and delete various windows along the way?  I.e., does
GtkAda (or the underlying GTK+) do any kind of automatic garbage
collection?

If I delete a top-level window (or container), are the resources for its
component parts also deleted? Or do I need to create procedures to
recursively destroy all the lower-level components?

Finally, are all resources freed up when a program exits?  What if the
program exits abnormally?  (I would have thought that everything was
freed upon exits, but there have been a couple of times that I went on
multi-day programming binges using GtkAda, and found that my X window
response got slower and slower until I logged out and back in.  These
sessions included a number of abnormal program terminations, such as
segfaults arising from trying to allocate excessively large data
structures.  Is it possible that GTK+ had caused X to allocate some
structures which were not properly released when the programs crashed?)

Thanks,

Bobby Bryant
Austin, Texas







More information about the gtkada mailing list