Conversation

Replying to
MEM_RELEASE will free the mapping completely like munmap on Linux, making the address space usable for other things. MEM_DECOMMIT will release the memory but hold onto the reserve address space like clobbering a mapping with mmap + MAP_FIXED + PROT_NONE on Linux.
2
2
Replying to and
MEM_DECOMMIT is the same as making a fresh mapping with VirtualAlloc using MEM_RESERVE. You go from a reserved mapping to usable memory with MEM_COMMIT like using mprotect for that purpose on Linux. Windows separates the concept of whether it's committed from protection mode.
1
2
Replying to and
It works the same way if you set /proc/sys/vm/overcommit_memory to 2 on Linux, i.e. memory accounting mode. There are a lot of common reasons to need to reserve contiguous memory for later use like GC collected heaps or just for huge dynamic arrays avoiding copying on growth.
1