Compiling C # with any processor sets The application can handle large (> 2 GB) addresses

I encountered this problem during performance testing.

When compiling a C # Console application with an x86 platform flag, the Large Address Aware flag is not set:

Exiting dumpbin / headers app.exe:

Dump of file app.exe PE signature found File Type: EXECUTABLE IMAGE FILE HEADER VALUES 14C machine (x86) 3 number of sections 569F0089 time date stamp Tue Jan 19 21:35:37 2016 0 file pointer to symbol table 0 number of symbols E0 size of optional header 102 characteristics Executable 32 bit word machine 

When setting the flag to "Any Cpu", the resulting exe is a large Aware address:

 Dump of file app.exe PE signature found File Type: EXECUTABLE IMAGE FILE HEADER VALUES 14C machine (x86) 3 number of sections 569F01D7 time date stamp Tue Jan 19 21:41:11 2016 0 file pointer to symbol table 0 number of symbols E0 size of optional header 22 characteristics Executable Application can handle large (>2GB) addresses 

Please note that "The application can handle large (> 2 GB) addresses."

I can not find documentation on this. All other questions suggest you do it manually:

How to enable IMAGE_FILE_LARGE_ADDRESS_AWARE in C # source code?

Can I install LARGEADDRESSAWARE from Visual Studio?

Use 3Gb memory in 32-bit applications

Question: where is this documented?

+5
c # memory visual-studio visual-studio-2015
Jan 20 '16 at 16:44
source share
1 answer

The goal of AnyCPU is to run managed code on x86 and x64 platforms, while at the same time take advantage of the large address space of x64 platforms. The only way to do this is to mark the binary as a large address when it targets AnyCPU. In addition, if this were not the case, it would be impractical to make the 32-bit default value preferred.

Where is this documented?

This was not explicitly documented, it was implied.

All other questions suggest you do it manually.

Regardless of all these questions and answers, this is only required with x86 targeting.

+2
Jan 22 '16 at 11:59
source share



All Articles