What's physically available changes over time as the OS moves pages in and out from disk to/from memory. Your virtual address space is limited to 4gb for 32bit applications, and usually around 256tb for 64bit applications (one large hole in the middle of the address space and 128tb chunks at the top and bottom).

The point I'm trying to make is that you shouldn't make any assumptions about the available memory on the system. Have a minimum requirement and let the OS do what it's good at: Managing resources. If you start allocating and using a lot of memory, the OS will first deal with the memory pressure by paging out unused memory pages so your application can use them. If your application has to start dealing with the memory pressure, you almost always have lost already.


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com