title: Memory Error in Visual Studio, but plenty of memory available
body: <p>This line of code produces the following error </p>
  
  <pre><code>rs[se_idx][ev_idx][re_idx].trs = new re_class[report_size];  
  </code></pre>
  
  <blockquote>
    <p>std::bad_alloc at memory location 0x0037c29c </p>
  </blockquote>
  
  <p>I think this is related to 'not enough memory'. When I decrease the amount being allocated, it runs fine.</p>
  
  <p>I have plenty of memory (16 GB) on the machine and a resource monitor shows only a tiny fraction of it is being used by visual studio. I added the compiler options <code>/F 4000000000</code> and <code>/LARGEADDRESSAWARE</code>, but still getting the error. </p>
  
  <p>How can this be solved?</p>