The limits are set by:
1. Available memory, obviously.
2. How fragmented memory is. Since an array has to reside in n adjacent bytes, if there are no n adjacent bytes available the allocation will fail, even if there are n or more bytes available total.
3. Operating system limitations. The compiler switch suggests you're compiling for Windows. The desktop 32-bit NT kernels enforce a 2 private GB limit for each program. I've also seen memory allocation failing at even lower margins, such as your case.
If you need to allocate that much memory, it's time to think about switching to a 64-bit kernel.