Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!indri!nic.MR.NET!ns!ddb From: ddb@ns.network.com (David Dyer-Bennet) Newsgroups: comp.lang.c Subject: Re: What if I don't free() all my dynamically allocated memory? Keywords: Not on a Unix system, that is. Message-ID: <1370@ns.network.com> Date: 9 May 89 18:36:40 GMT References: <2580@ssc-vax.UUCP> <386@nbires.nbi.com> <1384@dukeac.UUCP> <2239@athertn.Atherton.COM> <1391@dukeac.UUCP> <543@laic.UUCP> Sender: ddb@ns.network.com (David Dyer-Bennet) Reply-To: ddb@ns.UUCP (David Dyer-Bennet) Organization: Terrabit Software Lines: 26 In article <543@laic.UUCP> darin@nova.UUCP (Darin Johnson) writes: :The only thing that makes most OS's clear allocated memory on exit, is :virtual memory. Without it, the OS will have to go to a lot of work to :keep track of the memory you allocated. If you allocate averything off :of a stack, then it is no big deal, but what if you want to allocate something :that won't fit in your stack space? Believe it or not, there are a lot :of machines that don't have virtual memory, or keep track of the memory :you allocate, or have a near infinite upper bound on the stack? I believe :most small computers fall into this category, especially those that :multitask and/or support desktop thingies and stay resident thingies. TSS/8 on a PDP-8/I, RSTS on a pdp-11, TOPS-10 and TOPS-20 on KL-10 hardware, MS-DOS, and all versions of Unix I have seen do not display the behavior you describe as common above. Only Tops-10, Tops-20, and a few of the unixes are virtual-memory systems. Most of these probably count as "small computers" by today's standards :-) In my experience it's the presence of a "process" abstraction in the operating system that allows clean handling of un-freed memory at process termination. Even the 8088-based Unix was able to handle that. -- David Dyer-Bennet, ddb@terrabit.fidonet.org, or ddb@ns.network.com or ddb@Lynx.MN.Org, ...{amdahl,hpda}!bungia!viper!ddb or ...!{rutgers!dayton | amdahl!ems | uunet!rosevax}!umn-cs!ns!ddb or Fidonet 1:282/341.0, (612) 721-8967 9600hst/2400/1200/300