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-Thread: 103376,ec2a500cce3658c4 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Newsgroups: comp.lang.ada Subject: Re: Memory leak - What the ...? References: From: Brian May Date: Tue, 12 Oct 2004 13:02:18 +1000 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux) Cancel-Lock: sha1:IWAAArd9ZtmIumHPdkPoTPMctAk= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii NNTP-Posting-Host: dsl-202-173-153-89.vic.westnet.com.au X-Trace: news.melbourne.pipenetworks.com 1097550125 202.173.153.89 (12 Oct 2004 13:02:05 +1000) X-Complaints-To: abuse@pipenetworks.com X-Abuse-Info: Please forward all headers to enable your complaint to be properly processed. Path: g2news1.google.com!news2.google.com!news.maxwell.syr.edu!news-north.connect.com.au!news.alphalink.com.au!news.melbourne.pipenetworks.com!not-for-mail Xref: g2news1.google.com comp.lang.ada:5068 Date: 2004-10-12T13:02:18+10:00 List-Id: >>>>> "Stephen" == Stephen Leake writes: Stephen> There may be a bug with this in GNAT 3.15p on your OS. With Gnat 3.15p under Linux, I got: Debug Pool info: Total allocated bytes : 1530000 Total deallocated bytes : 1530000 Current Water Mark: 0 High Water Mark: 511008 Out of curiosity, I replaced the range of Arr to (1..1), and changed the Create/Adjust/Finalize to print an appropriate Message; Now I get: Adding... (Create)(Adjust)(Finalize)(Finalize)(Adjust)(Finalize)Deleting... (Finalize)(Adjust)Debug Pool info: Total allocated bytes : 36 Total deallocated bytes : 36 Current Water Mark: 0 High Water Mark: 24 (Finalize)(Finalize) Why does 1 create result in 2 adjusts and 3 finalize? (I would have expected number of adjust == number of finalize == 1) Why are there 2 finalize at the end? (I would have expected 1 maximum) Is there anyway of making this code more efficient? (It seems to me that a deep copy for a create operation just causes heap fragmentation with no real benefit.) -- Brian May