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

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.

 

附件尺寸
下载 forttestapp.zip4.89 KB
2 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

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 - Intel Developer Support

发表评论

登录添加评论。还不是成员?立即加入