I'm using C++ in Visual Studio 2013 on a Windows 7 x64 OS with 8.00 GB of RAM.
I'm programming a DLL and have a 2001 x 4001 array of const floats for a large lookup table of ~8 million values, which should be 32 MB.
Everything works fine when I compile without initializing the table with values and when I try to compile with initializing approximately 1400 x 4001 of the values.
However, when I try to initialize the entire 2001 x 4001 table, I get:
c1060 compiler is out of heap space error.
I've added /Zm200 (and /Zm1000) to the command line options, but then error becomes:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(341,5): error MSB6006: "CL.exe" exited with code 3.
I've tried in Debug and Release and get the same results.
Unfortunately I can't find anything helpful on this specific error.
I'm not sure where to look, but 32 MB doesn't seem to be an inordinate amount of memory and even if so, wouldn't the /Zm1000 have made plenty of memory available if the default /Zm100 was enough for nearly 3/4 of the table?
Finally, the vast majority of the DLL is the table. There are about 150 other lines of code in total but only a handful of standard variables (int, double, etc.) are in scope at any one time.
Here's the definition of the array:
static SKEWLOGISTICFUNCTIONSDLL_API const int shapeValues = 2001; // Enough for 0.000 to 2.000 in increments of 0.001
static SKEWLOGISTICFUNCTIONSDLL_API const int distanceValues = 4001; // Enough for -2.000 to 2.000 in increments of 0.001
static SKEWLOGISTICFUNCTIONSDLL_API const float skewLogisticTable[shapeValues][distanceValues];
And here's the start of the large table:
const float MySkewLogisticFunctions::skewLogisticTable[shapeValues][distanceValues] =
{
// Shape going down --> 0.000 to 2.000 in increments of 0.001
// Distance going across --> -2.000 to 2.000 in increments of 0.001
{ 0.119203, 0.119308, 0.119413, . . .