When I write C++ code that deals with large datasets, I try to avoid large continuous buffers as much as possible. For cache locality, an aligned 1GB buffer is practically the same as a set of 64 aligned continuous buffers, 16MB/each. You’ll only hit RAM latency when crossing the boundary between the buffers, i.e. only 63 times through the whole 1GB of data.
One problem is std::vector. The standard says the whole vector must be continuous, i.e. to split large buffer into smaller chunks, one needs to implement a custom container on top of that.
Apparently, authors of C++ think the problem will go away by itself, with the switch to 64-bit platforms.
https://msdn.microsoft.com/en-us/library/aa384271.aspx https://msdn.microsoft.com/en-us/library/aa366778.aspx
>> 4 GB with IMAGE_FILE_LARGE_ADDRESS_AWARE set
While we are at it. The flag is a bit in the header of the .exe file. It should be set at compile time in the visual studio option, but it can be set into any file really with an hex editor.
Don't expect to be able to use the 4 GB even with the flag. There is a lower hard cap that depends on the version of windows.
32-bit applications on 64-bit Windows can access a full 4GB virtual address space (if they are compiled with a special linker flag) without needing the 3GB Windows boot-time flag.