__int64 vs int – Memory Managed-Collection of common programming errors
The runtime will not always release memory back to the OS, it’ll keep memory around in case it’s needed in the future. Sometimes the memory is quite a bit fragmented as well, so there’s no easy way to release it back to the OS.
The allocator will usually reserve memory in (bigger than your program allocates) chunks, so looking at memory usage might not reflect the memory allocation and deallocation of your program.
It’s all virtual memory anyhow, so it doesn’t matter as much as exhausting the physical memory of your machine.