comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <Stephe.Leake@nasa.gov>
Subject: Re: Problem with memory leaks in Glade and GLADE
Date: 17 Sep 2003 10:14:12 -0400
Date: 2003-09-17T14:16:47+00:00	[thread overview]
Message-ID: <uoexjpknf.fsf@nasa.gov> (raw)
In-Reply-To: 2PN9b.1478$I9.42@newsfep4-winn.server.ntli.net

"Dr. Adrian Wrigley" <amtw@linuxchip.demon.co.uk.uk.uk> writes:

> I have got my client/server system running nicely now, based around
> Annex E (GLADE 3.15p, RedHat Linux 7.3, Intel etc.), and around
> GtkAda and GTK 2.2.  

Congratulations!

> Every second, I make a Set_Text call to display the current time:
> Set_Text (UpdateRecord.Window.Time_Label, Image (Time.Functions.Now));
> I make no attempt to free any associated memory.  Reading the documantation
> on GtkAda, I am led to believe that the reference counting will ensure
> this works OK.  The program consumes about 16kB *per second*, and
> brought my server to a state of near collapse after less than a day :(
> What am I doing wrong? (without the Set_Texts, memory usage is constant)

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.

Since GtkAda is based on Gtk, which is a very complex C program, all
kinds of things are possible :).

> The Annex E server also consumes constantly rising memory.
> 
> In this case, each time a client partition connects and terminates,
> the server partition grabs roughly another 200kB of memory.
> My server code only allocates with "new" in one place, and
> calls "Unchecked_Deallocation" shortly after.
> I am puzzled by this, and suspect that the PCS may be leaking.
> Any suggestions for tracing and solving this problem?

Try replacing the "new" and "Unchecked_Deallocation" with a stack
variable (just for testing, you can hard-code it; I assume you
actually _need_ the "new" in the real app). That will tell you whether
the Unchecked_Deallocation is actually deallocating.

-- 
-- Stephe



  reply	other threads:[~2003-09-17 14:14 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 [this message]
2003-09-22 12:16 ` Robert I. Eachus
2003-09-22 22:30 ` Dr. Adrian Wrigley
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