title: 2d-Array with more than 65535^2 elements --> Array dimensions exceeded supported range
body: <p>I've a 64-bit PC with 128 GB of RAM and I'm using C# and .NET 4.5.
  I've the following code:</p>
  
  <pre><code>double[,] m1 = new double[65535, 65535];
  long l1 = m1.LongLength;
  
  double[,] m2 = new double[65536, 65536]; // Array dimensions exceeded supported range
  long l2 = m2.LongLength;
  </code></pre>
  
  <p>I'm aware of <code>&lt;gcAllowVeryLargeObjects enabled="true" /&gt;</code> and I've set it to true. </p>
  
  <p>Why can a multidimensional array not have more than 4294967295 elements? 
  I saw the following answer <a href="https://stackoverflow.com/a/2338797/7556646">https://stackoverflow.com/a/2338797/7556646</a>.</p>
  
  <p>I checked as well the documentation for <a href="https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/runtime/gcallowverylargeobjects-element" rel="noreferrer">gcAllowVeryLargeObjects</a> and I saw the following remark.</p>
  
  <blockquote>
    <p>The maximum number of elements in array is <a href="https://docs.microsoft.com/en-us/dotnet/api/system.uint32.maxvalue?view=netframework-4.7.1" rel="noreferrer">UInt32.MaxValue</a> (4294967295).</p>
  </blockquote>
  
  <p>I cannot understand why there is this limit? Is there a workaround? Is it planned to remove this limit in an upcoming version of .net?</p>
  
  <p>I need the elements in that why in the memory because I want to compute for example a symmetric eigen-value decomposition using Intel MKL.</p>
  
  <pre><code>[DllImport("custom_mkl", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, SetLastError = false)]
  internal static extern lapack_int LAPACKE_dsyevd(
      int matrix_layout, char jobz, char uplo, lapack_int n, [In, Out] double[,] a, lapack_int lda, [In, Out] double[] w);
  </code></pre>