What are the reasons a malloc() would fail, especially in 64 bit?
My specific problem is trying to malloc a huge 10GB chunk of RAM on a 64 bit system. The machine ha
Just a guess here, but malloc allocates contiguous memory and you may not have a sufficiently large contiguous section on your heap. Here's a few things I would try;
Where a 20GB malloc fails, do four 5GB mallocs succeed? If so, it is a contiguous space issue.
Have you checked your compiler switches for anything that limits total heap size, or largest heap block size?
Have you tried writing a program that declares a static variable of the required size? If this works you could implement your own heap with big mallocs in that space.