Joseph Rushton Wakeling:

... but despite the GC.free(), memory usage stays at peak level for the rest of the runtime of the function.

GC.free() usually works. Some memory allocators don't give back the memory to the OS, no matter what, until the process is over, despite that memory is free for the process to use in other ways (this is what often happens in Python on Windows).

If I am right, then if you try to allocate memory from the same program after GC.free() the total memory used by that process will not increase.

Bye,
bearophile

Reply via email to