nts0699@dsacg1.UUCP (Gene McManus) (12/03/87)
Is there a way to release large blocks of malloc'd heap space back to the system when it is freed and no longer needed? General-purpose heap clean-up routine? I have an application that exec's other stuff (system("...") call) and I'd like to make all the memory available that I no longer need. Thanx ... Gene -- Gene McManus @ Defense Logistics Agency Systems Automation Center, Columbus, OH 43215 (614) 238-9403, Autovon 850- UUCP: {seismo!gould,cbatt!osu-cis}!dsacg1!gmcmanus The views expressed are my own, not those of The Agency, or Dept. of Defense
brianc@cognos.uucp (Brian Campbell) (12/10/87)
In article <279@dsacg1.UUCP> nts0699@dsacg1.UUCP (Gene McManus) writes: > Is there a way to release large blocks of malloc'd heap space back to the > system when it is freed and no longer needed? General-purpose heap clean-up > routine? I have an application that > exec's other stuff (system("...") call) and I'd like to make all the memory > available that I no longer need. Quote from Microsoft Customer Support Engineer when I asked the same question: The MSC 4.0 routine free(), used in conjunction with malloc() does not actually return the memory back to the operating system. However, if you use halloc() to allocate memory, then hfree() will actually release the memory to the operating system. -- Brian Campbell uucp: decvax!utzoo!dciem!nrcaer!cognos!brianc Cognos Incorporated mail: POB 9707, 3755 Riverside Drive, Ottawa, K1G 3Z4 (613) 738-1440 fido: (613) 731-2945 300/1200, sysop@1:163/8