c++winapimemoryramvirtual-memory

Get the maximum addressable memory space on a Win32 system


Is there a way on Win32 systems to programmatically get the full size of the OS's addressable memory space, using the Win32 API (or any accessible DLL that would be installed on a >=XP system). I know about GetPerformanceInfo and GlobalMemoryStatusEx, but the former only seems to deal with physical memory, and the latter pertains to memory addressable by my program, not the OS; since my program must be x86 and might be run on an x64 system, there is no guarantee this will even be ballpark.

Note: I'd prefer, but don't need, an exact size. I just need a "really good guess."


Solution

  • Do either of those satisfy your requirement?