The/LARGEADDRESSAWARE option notifies the linker application to handle addresses larger than 2 GB. in the 64-bit compiler, this option is enabled by default. In a 32-bit compiler,/largeaddressaware:no is enabled if/largeaddressaware is not specified on the linker line.
If you use/largeaddressaware to link an application, Dumpbin/headers displays information about the effect.
Set this linker option in the Visual Studio development environment
Open the Property Pages dialog box for the project. For more information, see Setting Visual C + + project properties.
Click the linker folder.
Click the System property page.
Modify the Enable large addresses property.
Do not need to largeaddressaware all Windows programs will be able to use 2g of memory, 2g or more need largeaddressaware, within 2g if your program in the allocation of large memory times OutOfMemory exception, In general, there are several situations:
1. Insufficient memory available
2. You start the program in VS2005 mode, and in the options of the project properties, you enable the VS2005 self-hosted mode debugging. VS2005 's own debug hosting environment seems to provide only 1g of memory address space.
3. A dynamically adjusted collection object is used, but capacity is not specified. such as arraylist,hashtable and so on. A collection object that uses dynamic adjustment when large memory needs to be requested must force the capacity upper bound, because the set dynamically adjusts the amount of memory required for capacity to be 3 times times the number of count. If you have free 2g of memory, using ArrayList without specifying Capacity,capacity is a double-growth strategy, When capacity uses 1g to add elements, the. NET requests 2g of space, which costs 3g of memory before you copy all the elements to the new memory.