In most runtime environments, the memory allocated for an application from the operating system remains in the application and rarely returns back to the operating system. Releasing a memory block allows you to reuse the block from the application, but does not free it from the operating system to make it available to other applications.
The Microsoft C Runtime Library attempts to return memory to the operating system by specifying the _heapmin_region call _heap_free_region or _free_partial_region that invoke VirtualFree to release data to the operating system. However, if whole pages in the corresponding area are not empty, then they will not be freed. A common reason for this is caching information and caching containers in C ++.
source share