Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28383 Discussions

Limits on size of stack under Linker system options

MarieJC
Novice
572 Views

Using VS2019 and 2021 compiler.

Under Linker System there are options to set stack size but the maximum number we can fill into stack reserve size and stack commit size is 2GB. That is not enough in our case. Is there a way to expand? And yes, we are working to dynamically allocate arrays but it's a lot of work. Trying to find another workaround adjusting compiler settings. 

Do we have a list of the default options for the 2021 compiler?

Would appreciate any help!

0 Kudos
1 Solution
Steve_Lionel
Honored Contributor III
564 Views

2GB is all you get in Windows, and even setting it that high will prevent your program from running. Try setting Fortran > Optimization > Heap Arrays > 0 and see if that helps. I recommend setting stack reserve to no more than 100MB.

The Compiler Options part of the documentation lists the defaults for each option. There is not a single list.

View solution in original post

5 Replies
Steve_Lionel
Honored Contributor III
565 Views

2GB is all you get in Windows, and even setting it that high will prevent your program from running. Try setting Fortran > Optimization > Heap Arrays > 0 and see if that helps. I recommend setting stack reserve to no more than 100MB.

The Compiler Options part of the documentation lists the defaults for each option. There is not a single list.

MarieJC
Novice
551 Views

What about the fact that exactly same code compiles and runs without any issues on similar Windows 10 machine but using Visual Studio 2008 and older version of compiler - 2011 (Intel Fortran 11).

We've tried VS2008 with Intel 2011 on a different Windows 10 machine and it didn't work - similar error as with VS 2019/Intel 2021. Could be environmental variables settings that we need to compare across these two Windows 10 machines?

Thank you!

0 Kudos
Steve_Lionel
Honored Contributor III
546 Views

Don't know. Are you getting stack overflow errors? The stack shares that 2GB with static code, data and pieces of Windows. There are no environmental settings involved here. It could be that you're just pushing over the limit of the stack you can use based on how Windows is also using that first 2GB. No, it can't be expanded, and the same limit applies to 64-bit systems.

0 Kudos
MarieJC
Novice
539 Views

@Steve_Lionel  On behalf of my entire team - THANK YOU!!! Apparently setting Fortran > Optimization > Heap Arrays > 0 did the magic!!! I've set it to 100MB originally; we might play with it in the future. Thanks again for your help!!! 

0 Kudos
Steve_Lionel
Honored Contributor III
530 Views

Glad to have been of assistance. You can mark my earlier response with that suggestion as the "solution" to the thread.

Reply