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=0.6 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FROM_WORDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fe0d58e5e40e10c7 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news2.volia.net!news.germany.com!solnet.ch!solnet.ch!nntpfeed.zonnet.nl!news.versatel.net!not-for-mail From: "Wiljan Derks" Newsgroups: comp.lang.ada References: Subject: Re: many exceptions cause memory leak? Date: Tue, 25 Oct 2005 20:50:21 +0200 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2670 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2670 X-RFC2646: Format=Flowed; Response Message-ID: <369da$435e7da8$3ea6010b$8607@news.versatel.net> X-Complaints-To: abuse@versatel.nl Organization: Versatel Nederland B.V. NNTP-Posting-Host: 62.166.1.11 (62.166.1.11) NNTP-Posting-Date: Tue, 25 Oct 2005 20:47:04 +0200 X-Trace: 369da435e7da89b03a4ae08607 Xref: g2news1.google.com comp.lang.ada:5931 Date: 2005-10-25T20:50:21+02:00 List-Id: "Christopher Broeg" wrote in message news:djknki$cl6$1@lc03.rz.uni-jena.de... >> Global information >> ------------------ >> Total number of allocations :109993 >> Total number of deallocations :97243 >> Final Water Mark (non freed mem) : 29.85 Megabytes >> High Water Mark : 29.90 Megabytes Still looks like you are loosing memory. Maybe a good tip: When and exception occurs one can easily asume that an inout variable of a procedure alsready has the value assigned to its end location. Thus something like this: procedure zzz(x: in out access y) is begin x:=new ... exception here end; When an exception occurs, one could assume that the new pointer is already assigned to the structure that was passed to zzz. That is however not the case when using gnat. Typically, the inout parameter is a local variable for the procedure that is stored on its final location when doing a normal procedure exit. This is a typical reason for loosing memory when doing exception processing. Changing the mode from inout to and access parameter fixes that.