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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: border1.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!usenet.blueworldhosting.com!feeder01.blueworldhosting.com!feeder.erje.net!eu.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: anon@att.net Newsgroups: comp.lang.ada Subject: Re: newbie: can't read fast enough... :-) memory leaks... Date: Fri, 5 Sep 2014 21:54:07 +0000 (UTC) Organization: Aioe.org NNTP Server Message-ID: References: <479b2efe-0238-4b2a-8b05-cb1a0b4a57e5@googlegroups.com> Reply-To: anon@att.net NNTP-Posting-Host: TJbD2+8701zJMRZcaCWoCA.user.speranza.aioe.org X-Complaints-To: abuse@aioe.org X-Notice: Filtered by postfilter v. 0.8.2 X-Newsreader: IBM NewsReader/2 2.0 Xref: number.nntp.dca.giganews.com comp.lang.ada:188886 Date: 2014-09-05T21:54:07+00:00 List-Id: But the "free()" from the C-library or OS links does not fully reclaim memory and no other program can use this memory until the program ends. Unless, that memory is setup as a OS share resource. That's why I said the programmer needs to modify these routines to add Garage Collection (GC), but any GC algorithm will slow the program down. All of GNAT's memory/storage pools packages and Memory package has its pluses and its minuses. Now, the Global and Local default pools allow dynamic allocation without using the Ada attributes. So modifying these packages a programmers can add monitor all programs allocations including the creation of static variables. While the others pools in GNAT use static or stack allocated data and can only monitor it own data. Now it seams that the map for pools is Runtime pools Memory Pool_Global -- no automatic reclaim -- default pool for all storage Pool_Local -- handles unbounded reclaim pool -- reclaimed at pool finalization -- uses System.Pool_Global -- default pool Pool_Size -- stack bounded pool -- reclaimed by normally stack management User defined pools Memory Storage_Pools -- user defined static pool Undefined pools Memory Pool_Empty -- GNAT compiler does reference package Remote_Pools -- comments in GNAT compiler which reference the -- Implementation Permissions of the -- RM: Remote Call Interface Library Units -- So, package is not included or fully supported -- in GNAT runtime Special pools Memory Checked_Pools -- Similar to Storage_Pools with Dereference monitoring Debug_Pools -- Package to help track down memory corruption -- uses Checked_Pools In , Simon Wright writes: >anon@att.net writes: > >> The "Deallocation" routine is normally unfunctional so memory is >> "reclaimed" during program finalization only. > >For GCC 4.9.0, Deallocate (both Pool_Global and Pool_Local) calls >Memory.Free which calls free().