<p>My understanding is that in unix, when memory is freed, the memory doesn't get returned back to the operating system, it stays in the process to be used again for the next call to malloc.</p>

<p>On windows, I understand that the memory actually gets returned to the operating system.</p>

<p>Is there any big difference between these two ways of doing things or are they just two different ways of doing the same thing?  And if there are any pros/cons to these two methods, what are they?</p>

<p><strong>EDIT:</strong>  Thanks for the clarification.  I had always thought this was an OS thing (since processes never seem to decrease in size in UNIX-like systems, but do in windows).</p>

From this
Memory Management
article
Malloc does not normally return the freed memory to the operating system; it remains owned by the process until it terminates. The process can reuse it the next time it requests more memory, but other programs will not have access to it, even if no other memory is available. As a corollary, then, the memory footprint of a program is the size of the largest allocation(s) made at any one time. Thus it is always wise to free objects you do not need, especially large ones as soon as possible, to minimize this footprint.
That article does suggest that in Windows, at least for C program, the memory is not returned to the OS.
So I am not sure about your generalization about windows memory deallocation.
That said, you can try and
Emulating UNIX Memory Management Under Microsoft Windows
, by implementing low level system calls sbrk and mmap/munmap on Windows.