Use 3Gb memory in 32-bit applications

I am developing an application that imports a large amount of data into some stream of parallels.

Sometimes I get an OutOfMemoryException (when I use something like 1.5, 1.7GB RAM).

There is no big deal, I thought that I would make it a 64-bit program (because it is not so huge). But due to a .Net error (cannot have a 64-bit decimal primary key), I just can't make a 64-bit program. (a description of the problem and I found a lot of other case. And I just can’t change anything in this database, not even type or add a view).

I do not need much more than 1.5-1-7 GB of RAM. If I could achieve something like 2.5 GB, I would be happy.

I read something about "LARGEADDRESSAWARE", but I did not find where to install it on my visual studio, and most of the other tips that say that I should modify the boot.ini file.

But since my computer is already 64-bit computers (with something like 8 GB of RAM), I don’t think I have to do something here.

So what should I do to access these 3 GB of RAM?

0
c # memory
Sep 18
source share
2 answers

Use editbin to set the LARGEADDRESSAWARE flag as suggested in Can I install LARGEADDRESSAWARE from Visual Studio? .

editbin /largeaddressaware $(TargetPath) 

You need to run the x64 version of Windows or, as you already mentioned, to 32-bit change the Boot.ini system so that applications can use the 3Gb address space with / 3GB .

+1
Sep 18
source share
β€” -

The 32-bit application has a 4GiB virtual address space. If I remember correctly, Windows by default split this into 2GiB for the application (including code, stack, data) and 2GiB for the system.

There should be a way to change this to 3 GiB for the application and 1 GiB for the system, but I don’t think you can go beyond that anyway.

0
Sep 18 '12 at 5:01
source share



All Articles