Compile with /3G extended memory space

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using VS2003. How can I compile a (32-bit) C# project so that the
program can use more than 2GB of memory space?

I came across a /3G compile option searching on this subject, that is
supposed to give a process 3GB before throwing OutOfMemory. But I can't find
any documentation on how to apply it to C# or in Visual Studio.
 
Dave Booker said:
I am using VS2003. How can I compile a (32-bit) C# project so that the
program can use more than 2GB of memory space?

I came across a /3G compile option searching on this subject, that is
supposed to give a process 3GB before throwing OutOfMemory. But I can't
find
any documentation on how to apply it to C# or in Visual Studio.

There is no such option for C#, you'll have to patch the headers in your PE
file using editbin.exe.

editbin /largeaddressaware yourprog.exe

Note: you should also set the /3GB switch in your boot.ini file, you can
also set the USERVA switch when running W2k3.
There is no guarantee you wont get any OOM exception when applying this to
your code, it might be possible that a contigious block of memory is not
available even when there plenty of free memory due to fragmentation of the
native heap and the managed heap
Willy.
 
Back
Top