title: Why 2 GB memory limit when running in 64 bit Windows?
body: <p>I'm a member in a team that develop a Delphi application. The memory requirements are huge. 500 MB is normal but in some cases it got out of memory exception. The memory allocated in that cases is typically between 1000 - 1700 MB.</p>
  
  <p>We of course want 64-bits compiler but that won't happen now (and if it happens we also must convert to unicode, but that is another story...).</p>
  
  <p>My question is why is there a 2 GB memory limit per process when running in a 64 bit environment. The pointer is 32 bit so I think 4 GB would be the right limit.
  I use Delphi 2007.</p>
  
  <p><strong>EDIT:</strong>
  So if I set the IMAGE_FILE_LARGE_ADDRESS_AWARE flag in Delphi by using:</p>
  
  <pre><code>{$SetPeFlags IMAGE_FILE_LARGE_ADDRESS_AWARE}
  </code></pre>
  
  <p>And running the resulting Exe-file on a Windows Server 2003 x64 then the application can address 4 GB ? </p>
  
  <ul>
  <li>Should I set /3GB switch in boot.ini ?</li>
  <li>We have tried this but on a 32 bit Windows Server 2003 and it seems to limit the windows resources. There was more exceptions for "Out of memory" with GDIError in the log. But maybe this disappear when running in a 64 bit OS ?</li>
  </ul>