How to change stack size for a .NET program?

The easiest way to set the stack size from .NET 2.0 and Win XP onwards is to spawn a new thread with the stack size you’d like:-

using System.Threading;

Thread T = new Thread(threadDelegate, stackSizeInBytes);
T.Start();

To change the stack size of the entire program you’d have to use editbin:-

EDITBIN.EXE /STACK:<stacksize> file.exe

Leave a Comment

tech