Path: utzoo!attcan!uunet!lll-winken!brutus.cs.uiuc.edu!apple!oliveb!amiga!cbmvax!jesup From: jesup@cbmvax.UUCP (Randell Jesup) Newsgroups: comp.sys.amiga.tech Subject: Re: Memory usage Message-ID: <7662@cbmvax.UUCP> Date: 15 Aug 89 02:20:51 GMT References:<1410023@hpcvca.CV.HP.COM> <7638@cbmvax.UUCP> <121373@sun.Eng.Sun.COM> Reply-To: jesup@cbmvax.UUCP (Randell Jesup) Organization: Commodore Technology, West Chester, PA Lines: 44 In article <121373@sun.Eng.Sun.COM> cmcmanis@sun.UUCP (Chuck McManis) writes: >Rewriting malloc to be faster is an old game, lots of people play. This whole >bit about memory usage and calls are a religious argument but the two sides >can be pretty clearly defined : > >The Package Argument : I use a memory management package that keeps track of ... >The System Call Argument : I use the system calls for allocating and freeing ... Quite true (btw, my replacement gave both: smaller and faster than malloc, and it released everything for me if I hadn't when I exited.) >>if it drops memory every time it can add up quickly.) > >This, on the other hand, is specious. If one writes a subroutine that has a >memory leak then that is a bug in any system. If you are building data >structures and returning them to your client that's one thing, but losing >memory is just a bug. Maybe, but I've seen LARGE professional systems that do this. Admittedly, some of the people who do this are used to systems that garbage collect for them. For example, to quote from the Ada green reference manual (old, but all I have on me): "An object created by the execution of an allocator remains allocated for as long as this object is accessible directly or indirectly, that is, as long as it can be designated by some name. When such an object becomes inaccessible, the storage it occupies can be reclaimed (but need not be), depending on implementation." page 4-23, section 4.8 Ada has NO way to free allocated memory. BTW, I haven't seen an Ada compiler that did garbage collection yet (though having said that, I'm sure someone will point out that I'm wrong.) Can you say "VM Hog"? better learn if you run Ada. I believe (though I'm more likely to be wrong here) that LISPM's have the same sort of problem, when programmed in lisp (though they do have garbage collectors, and they make themselves known frequently.) -- Randell Jesup, Keeper of AmigaDos, Commodore Engineering. {uunet|rutgers}!cbmvax!jesup, jesup@cbmvax.cbm.commodore.com BIX: rjesup Common phrase heard at Amiga Devcon '89: "It's in there!"