comp.lang.ada
 help / color / mirror / Atom feed
From: "Dr. Adrian Wrigley" <amtw@linuxchip.demon.co.uk.uk.uk>
Subject: Re: Problem with memory leaks in Glade and GLADE
Date: Mon, 22 Sep 2003 23:30:33 +0100
Date: 2003-09-22T23:30:33+01:00	[thread overview]
Message-ID: <eKKbb.2024$jJ3.32654@newsfep4-glfd.server.ntli.net> (raw)
In-Reply-To: <2PN9b.1478$I9.42@newsfep4-winn.server.ntli.net>

I wrote:
...
> The GUI client (designed with Glade) consumes monotonically increasing 
> memory.
> 
> Every second, I make a Set_Text call to display the current time:
> Set_Text (UpdateRecord.Window.Time_Label, Image (Time.Functions.Now));

Unfortunately I have made little progress in solving the GtkAda problem,
other than identifying it as being more general than my specific code.

I have tried running the "testgtk" program supplied with GtkAda, and find
monotonic use of memory.

In particular, simply moving the pointer into the testgtk window consumes
a massive 52kB *each time*.  I can see the memory use rachet up simply by
moving the pointer in and out of the window.

Using any of the features sucks in more memory, for example, each time the
"Sheet" widget is used another 115kB disappears.

I can see why the writers of testgtk might not bother to free memory when
creating widgets, but it does give a bad impression to the casual user if
each time the pointer passes by another 52kB of memory is used.

The testgtk program is also convenient for seeing how to access the various
features of the interface, but if it is "incorrect" code because it
leaks like a sieve, it risks causing people serious trouble later.

I guess I should seek asistance on this topic on one of the mailing lists...

For the moment, I can tolerate restarting my GUI clients daily, during which
time, they don't manage to bring my system down. Much longer, and it hits
2GB process size or more, or runs out of total system memory+swap :(

Stephe wrote:
 > I have not tried this, but perhaps Image is allocating a string that you
 > need to free? Try replacing the call to Image with a constant string, just
 > to see what happens.

Thanks for the suggestion.  I tried the constant string, but the problem
remained the same. (my Image function doesn't allocate)

Thanks for listening!
-- 
Dr Adrian Wrigley, Cambridge, UK.




  parent reply	other threads:[~2003-09-22 22:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-17  0:22 Problem with memory leaks in Glade and GLADE Dr. Adrian Wrigley
2003-09-17 14:14 ` Stephen Leake
2003-09-22 12:16 ` Robert I. Eachus
2003-09-22 22:30 ` Dr. Adrian Wrigley [this message]
2003-09-23 13:14   ` Stephen Leake
2003-09-23 23:53     ` Dr. Adrian Wrigley
2003-09-24  1:21       ` Jeff C,
2003-10-03 17:27   ` Dr. Adrian Wrigley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox