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-22 15:30:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!yellow.newsread.com!netaxs.com!newsread.com!feed2.newsreader.com!newsreader.com!news2.telebyte.nl!newsfeed.stueberl.de!newspeer1-gui.server.ntli.net!ntli.net!newsfep4-glfd.server.ntli.net.POSTED!53ab2750!not-for-mail From: "Dr. Adrian Wrigley" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Problem with memory leaks in Glade and GLADE References: <2PN9b.1478$I9.42@newsfep4-winn.server.ntli.net> In-Reply-To: <2PN9b.1478$I9.42@newsfep4-winn.server.ntli.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 22 Sep 2003 23:30:33 +0100 NNTP-Posting-Host: 81.100.88.147 X-Complaints-To: abuse@ntlworld.com X-Trace: newsfep4-glfd.server.ntli.net 1064269834 81.100.88.147 (Mon, 22 Sep 2003 23:30:34 BST) NNTP-Posting-Date: Mon, 22 Sep 2003 23:30:34 BST Organization: ntl Cablemodem News Service Xref: archiver1.google.com comp.lang.ada:42763 Date: 2003-09-22T23:30:33+01:00 List-Id: 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.