Heap Reserve/Commit and Stack Reserve/Commit values greater than 2GB can not be set for a 64-application

Heap Reserve/Commit and Stack Reserve/Commit values greater than 2GB can not be set for a 64-application

Ritratto di Sergey Kostrov

Heap Reserve/Commit and Stack Reserve/Commit values greater than 2GB can not be set for a 64-bit application in a Visual Studio. Please look and try at Properties -> Linker -> System.

For any of these four parameters ( Heap Reserve/Commit and Stack Reserve/Commit ):

Value 2147483647 (  2*2^30 - 1 = 2GB - 1 byte ) can be set
Value 2147483648 (  2*2^30 = 2GB ) can not be set and a dialog box is displayed:

Title: Properties Window

Text: Property value is not valid

Details: Operation SetValue on the component did not succeed, generating the error code 0x8002000A.

This is a very strange limitation for 64-bit applications. A test project is attached.

 

AllegatoDimensione
Scarica forttestapp.zip4.89 KB
2 post / 0 new
Ultimo contenuto
Per informazioni complete sulle ottimizzazioni del compilatore, consultare l'Avviso sull'ottimizzazione
Ritratto di Steve Lionel (Intel)

First of all, even on x64, the stack is limited to about 1GB.  You can set somewhat higher values but problems start to appear if you do.

In VS2008, MSVC will also reject a value higher than 2147483647, though rather than an error it just sets the value to the maximum it likes. In VS2010, MSVC accepts the higher value (but Fortran does not). The built application does not run, though.  MSDN says that this value is an "int" when discussing how to set this programmatically. It doesn't specify a limit on the command line.

I would argue that these options really have no useful purpose on x64. I saw in another thread you were trying to use them but I think you're going in a wrong direction.

Steve

Accedere per lasciare un commento.