How can I programmatically determine the maximum user mode (Windows) space of an OS?
GlobalMemoryStatusEx will give you a MEMORYSTATUSEX struct with ullTotalVirtual
:
The size of the user-mode portion of the calling process's virtual address space, in bytes. This value depends on the process type, processor type, and operating system configuration. For example, this value is approximately 2 GB for most 32-bit processes on an x86 processor, and approximately 3 GB for 32-bit processes that have a large address that runs on a system that supports 4 GB tuning.
Note that you will need to mark your EXE as LARGEADDRESSAWARE in order to see the 3GB in your process .
I think there is another function that also returns this information (no-not GlobalMemoryStatus , which is deprecated) along with the processor information - but I may not think about this ATM.
a source to share