What if I don't free() all my dynamically allocated memory?

David Dyer-Bennet ddb at ns.network.com
Wed May 10 04:36:40 AEST 1989


In article <543 at laic.UUCP> darin at 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 at terrabit.fidonet.org, or ddb at ns.network.com
or ddb at 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



More information about the Comp.lang.c mailing list