From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8727a81126dc209a X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-09-17 07:18:27 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: Problem with memory leaks in Glade and GLADE Date: 17 Sep 2003 10:14:12 -0400 Organization: NASA Goddard Space Flight Center (skates.gsfc.nasa.gov) Message-ID: References: <2PN9b.1478$I9.42@newsfep4-winn.server.ntli.net> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1063808207 9799 128.183.235.92 (17 Sep 2003 14:16:47 GMT) X-Complaints-To: usenet@news.gsfc.nasa.gov NNTP-Posting-Date: 17 Sep 2003 14:16:47 GMT User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Xref: archiver1.google.com comp.lang.ada:42617 Date: 2003-09-17T14:16:47+00:00 List-Id: "Dr. Adrian Wrigley" 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