title: Initializing 2001 x 4001 const float array gives out of heap space/"CL.exe" exited with code 3 error
body: <p>I'm using C++ in Visual Studio 2013 on a Windows 7 x64 OS with 8.00 GB of RAM.</p>
  
  <p>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.</p>
  
  <p>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.</p>
  
  <p>However, when I try to initialize the entire 2001 x 4001 table, I get:</p>
  
  <p>c1060 compiler is out of heap space error.</p>
  
  <p>I've added /Zm200 (and /Zm1000) to the command line options, but then error becomes:</p>
  
  <p>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(341,5): error MSB6006: "CL.exe" exited with code 3.</p>
  
  <p>I've tried in Debug and Release and get the same results.</p>
  
  <p>Unfortunately I can't find anything helpful on this specific error.</p>
  
  <p>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?</p>
  
  <p>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.</p>
  
  <p>Here's the definition of the array:</p>
  
  <pre><code>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];
  </code></pre>
  
  <p>And here's the start of the large table:</p>
  
  <pre><code>    const float MySkewLogisticFunctions::skewLogisticTable[shapeValues][distanceValues] =
  {
      // Shape going down --&gt; 0.000 to 2.000 in increments of 0.001
      // Distance going across --&gt; -2.000 to 2.000 in increments of 0.001
      { 0.119203, 0.119308, 0.119413, . . .
  </code></pre>