I'm developing an application which import a lot of data, in some paralells thread.
Sometimes I got the OutOfMemoryException(when I use something like 1.5, 1.7GB of ram).
No big deal, I thought that I will make this a 64bit program(because it's not so huge). But because of a .Net bug(cannot have a primary key in decimal in 64 bits), I just cannot make a 64 bits program.( <a href="https://stackoverflow.com/questions/5480972/clr-detected-an-invalid-program-with-entity-framework" rel="nofollow">description of the problem</a> and I found many other case. And I just can't change anything in this database, not even a type or add a view).
I don't need a lot more than the 1.5-1-7GB of RAM. If only I can reach something like 2.5GB, I will be happy.
I read something about the "LARGEADDRESSAWARE", but I didn't find where to set it on my visual studio, and most of other tips where saying that I should modify the boot.ini file.
But since my computer is already a 64bits computers(with something like 8GB of ram), I don't think I've to do something here.
So what should I do to get access to those 3GB of ram?Answer1:
Use editbin to set LARGEADDRESSAWARE flag like suggested in <a href="https://stackoverflow.com/questions/2597790/can-i-set-largeaddressaware-from-within-visual-studio" rel="nofollow">Can I set LARGEADDRESSAWARE from within Visual Studio?</a>.
editbin /largeaddressaware $(TargetPath)
You need to run x64 version of Windows or as you've mentioned for 32bit system change Boot.ini to allow apps use 3Gb of address space with <a href="http://msdn.microsoft.com/en-us/windows/hardware/gg487508.aspx" rel="nofollow">/3GB</a> switch.Answer2:
A 32 bit application has 4GiB of virtual address space. If I remember correctly Windows by default split that into 2GiB for the application (including code, stack, data) and 2GiB for the system.
There should be a way to change that to 3 GiB for the application and 1 GiB for the system, but I do not think you can go beyond that in any case.