From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: free() DOESN'T return memory to system Date: 19 Sep 2000 14:28:34 GMT Organization: Aachen University of Technology (RWTH) Lines: 25 Distribution: world Message-ID: <8q7t6i$f0e$1@nets3.rz.RWTH-Aachen.DE> References: <384411007 DOT 969036196326 DOT JavaMail DOT root AT web305-mc DOT mail DOT com> <969078416 DOT 841936 AT shelley DOT paradise DOT net DOT nz> <969134119 DOT 601345 AT osiris DOT esoterica DOT pt> <8q552e$m1c$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <4d7cssg4vt0hv5c6lnfshgmm3fmmbrf9r1 AT 4ax DOT com> NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 969373714 15374 137.226.32.75 (19 Sep 2000 14:28:34 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 19 Sep 2000 14:28:34 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Damian Yerrick wrote: > On 18 Sep 2000 13:24:30 GMT, Hans-Bernhard Broeker > wrote: [... regarding free() ... ] >> It *does* make the memory available for use by later malloc() calls >>in the same program. > So what call makes memory available for programs that you spawn()? None does. DPMI might very well even forbid doing it (haven't really looked it up). A spawn()ed program has no particular relationship to its parent, except that they're running on the same machine, under the same OS. Actually freeing all freeable heap was a necessity back in the days of DOS, where the spawn()ed process would need to use the same 640 KB the parent lived in. Even then, this usually was not done by compactification of the heap or some such measure, but rather by swapping out the parent to EMS or harddisk, while the spawn() ran. But with virtual memory and all that, such trickery should essentially no longer be needed. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.