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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3498dd887729ed19 X-Google-Attributes: gid103376,public From: kilgallen@eisner.decus.org (Larry Kilgallen) Subject: Re: Garbage Collection in Ada Date: 1996/10/23 Message-ID: <1996Oct23.114606.1@eisner>#1/1 X-Deja-AN: 191514334 x-nntp-posting-host: eisner.decus.org references: <01bbb910$f1e73f60$829d6482@joy.ericsson.se> <199610132138291604607@dialup101-6-14.swipnet.se> <19961015122319668722@dialup98-6-12.swipnet.se> <54kjat$hpn$1@goanna.cs.rmit.EDU.AU> x-nntp-posting-user: KILGALLEN x-trace: 846085571/28319 organization: LJK Software newsgroups: comp.lang.ada Date: 1996-10-23T00:00:00+00:00 List-Id: In article <54kjat$hpn$1@goanna.cs.rmit.EDU.AU>, ok@goanna.cs.rmit.EDU.AU (Richard A. O'Keefe) writes: > In a system which achieves economies (if such economies exist) by not > doing garbage collection, it is much harder to provide such facilities. > You can indeed ask where the currently retained blocks were _allocated_ > (or at least you can in the memory debugging library I use for C), but > you can't ask "_why_ is this block retained?" My experience is with the VMS tool which gives an allocation-time stack trace for any block of memory which is left over at image exit (or some other convenient time). Knowing how it was allocated has generally been sufficient to find the problem. There may be complicated logic failures on my part which led to a failure to deallocate, but they are not something susceptible to automation. In fact, that might be an argument against use of GC for me, since I would rather learn that _I_ was not cleaning up right than learn that the GC did not clean up after me. At the same time I failed to clean up memory I might have also failed to perform some other cleanup activity which is harder to detect. Yes, I know, the Ada standard does not guarantee any memory will be returned ever. The result of that is that if there is a choice I will gravitate toward implementations which _do_ return memory so that I have that aid in learning what I have done wrong. Considering that I make mistakes, perhaps I should always develop without GC and always run "production" with GC. Larry Kilgallen