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
What does "hold onto" mean in this context? Does it mean the process continues to reserve the memory but the content pages are discarded?
1
1
Replying to
It has the memory mapping but you can't use the memory because it's not committed, i.e. it can't assign pages to it if you touch it. It's just like having PROT_NONE mappings on Linux. The reason this exists is because Windows is designed around memory accounting, not overcommit.
1
1
Replying to and
Linux has a memory accounting mode via /proc/sys/vm/overcommit_memory and it just treats fresh PROT_NONE mappings the way Windows does MEM_RESERVE mappings. Not really a way to do MEM_DECOMMIT on Linux other than clobbering with a new PROT_NONE mapping via mmap with MAP_FIXED.
2
2