title: [Memory allocation problem]Unhandled exception: Microsoft C++ exception: std::bad_alloc at memory location
body: <p>I am using visual studio 2008 for developing. My program needs to deal with a huge amount of memory. The error happens when my program try to allocate a 512M float array. Code is the following:</p>
  
  <pre><code>int size = 512*512*512;
  float *buffer = new float[size];
  </code></pre>
  
  <p>Before this allocation, the program already consumed around 554M memory. My desktop has 4G main memory and I am using windows xp 32bits. </p>
  
  <p>How can I avoid the allocation error? Thanks very much for your input!</p>