When is it time for a 1.0 feature freeze?

Walter Bright newshound at digitalmars.com
Sun Sep 3 12:14:00 PDT 2006


Serg Kovrov wrote:
> Walter, thanks for your kind and comprehensive answer, but I still do 
> not get this 'malloc/free do not return memory to OS' part.
> 
> I just tried simplest example with GCC(mingw): I allocated with 'new' 
> 1Mb string. Then in process explorer (or in FAR's Process list) I can 
> see my process usage of 'Private bytes' increases equivalently. When 
> free this string, with 'delete', i see that 'Private bytes' usage 
> dropped to same level it was before. Isn't this mean that memory 
> returned to OS?

Not necessarily. There's a difference between physical memory and 
virtual memory. The OS will automatically take away from the process any 
unused physical memory, although the process retains it as virtual 
memory. If the process explorer watches physical memory, then that's 
what it's seeing.



More information about the Digitalmars-d mailing list