Is there something special you have to do to get large chunks of memory on Windows or in Visual Studio?
c, visual-studio-2012
Solution
You likely have your project settings set to build a 32-bit Application.
While your computer may have tons of free memory, a 32-bit application cannot use more than 2GB. By my estimate, 4 bytes x 650M is around 2.6 GB.
Try changing your project settings to build for a 64-bit platform.
But still ask yourself why you're allocating so much memory at once. That could well indicate a program design problem.
Problem
This is the call I am making. ``` table = (int *) malloc(sizeof(int) * (C+1) * (N+1)); ``` `C+1*N+1` comes out to be 657,562,500 But this call is returning a `NULL` for me when executed on Windows (indicating it could not allocate that amount of space). (it works fine with a smaller number and also works fine with larger numbers than this on my Linux box) The program doesn't really do much before this. When I look at Task Manager it shows 28.1 GB of available memory. So I am wondering, is there something I can set in Visual Studio like a compiler flag or something that will allow me to grab large chunks of memory like this? If my math is correct I believe I am asking for about 1.22GB. Appreciate any help Edit: So apparently I need to run this as a 64-bit application. Anyone know how to change a c project to 64-bits in visual studio? In configuration parameters under platform Win32 is the only option.