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,32ab3f0888d7e4b2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!news4.google.com!newshub.sdsu.edu!elnk-nf2-pas!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!newsread3.news.pas.earthlink.net.POSTED!a6202946!not-for-mail From: "Jeffrey R. Carter" Organization: jrcarter at acm dot org User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Memory Leak References: <1136304945.663764.14490@g14g2000cwa.googlegroups.com> In-Reply-To: <1136304945.663764.14490@g14g2000cwa.googlegroups.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Tue, 03 Jan 2006 18:06:23 GMT NNTP-Posting-Host: 67.3.212.181 X-Complaints-To: abuse@earthlink.net X-Trace: newsread3.news.pas.earthlink.net 1136311583 67.3.212.181 (Tue, 03 Jan 2006 10:06:23 PST) NNTP-Posting-Date: Tue, 03 Jan 2006 10:06:23 PST Xref: g2news1.google.com comp.lang.ada:2432 Date: 2006-01-03T18:06:23+00:00 List-Id: markp wrote: > We are experiencing a memory leak in out GNAT Ada program that we > cannot explain. We've narrowed it down to our generic queue package as > the culprit. However, all the memory in the package is allocated at > instantiation. I've attached the source code and if anybody can see > something, it would be greatly appreciated! The data types passed in > during the instantiation are variant records. Lastly, does GNAT provide > any queuing sevices? This is a curious monster; it can't decide if it wants to be an ADT or an ASM, and queues with negative depths seem to be meaningful. However, there is nothing about it that would seem likely to cause a memory leak. It might have something to do with where and how it is instantiated, or perhaps the types used to instantiate it. GNAT has GNAT.Bounded_Buffers, or you could use something from one of the many fine libraries of Ada components available, like PragmARC.Queue_Bounded_Blocking. They have more coherent designs and a better grasp of the issues involved in Ada concurrency. -- Jeff Carter "Nobody expects the Spanish Inquisition!" Monty Python's Flying Circus 22