[Migrated content. Thread originally posted on 05 March 2012]
Hello, i'd like to comprehend the m$free behaviour in runtime >= 9 and in previous runtime versions. In our company we use it intensively and i noticed that when a significant amount of memory is allocated, say 60Mb, (not necessary contiguous, i.e. not to the same pointer), then the m$free doesn't free it when called.Quoting the doc:
This memory is returned to the pool of memory available for use by the runtime. On most operating systems, this memory is still associated with the runtime's process, so it cannot be used by any other processes
Ok, following the doc i would expect the following behaviour (i observed the memory usage with the Windows 7 task manager):
1. Allocate a series of data structures --> wrun32 is 60Mb
2. deallocate all structures with m$free --> wrun32 is still 60Mb as the memory is usable only from the current process
3. Reallocate the same series of data structures --> wrun32 is still 60Mb as the runtime reused the previously freed memory
How it actually behaves:
3. Reallocate the same series of data structures --> wrun32 raise to around 120Mb
Moreover, i noticed that in runtimes = 9, a little amount of memory is still allocated after the m$free call.
Could you plese help me understand this? Is that a bug or this is the wanted behaviour? If so, it is not acceptable for our business context.
