How can I calculate the amount of free virtual address space my process have on Windows?
My application need to limit the amount of address space used. So I need to estimate how many memory I have consumed and how many virtual memory is left. If I have just a few hundred megabytes of address space left, my process begins to use a custom paging system to avoid loading to much data in memory.
And more important: this needs to be calculated per process, because I only care about my process, I am still using Win32.
I have tried VirtualQuery(), but it is not returning the total address space remaining.
Thank you.