Is there a way to monitor the call stack size in Visual Studio ? A call stack window is provided while running but does not show the size of the stack. I am using C++ and fa
The "Microsoft Recommended Native Rules" Code Analysis can look at your code and find problems with your code that might overflow your stack. I'm not sure how good it is at finding a recursion problem, but it did find an issue in my code where I used a local instance of a class that was very big (1MB). At runtime, the only error was a stack overflow. It's a bad idea to use large objects on the stack of course; you should only use small objects and objects that store most of their dirty laundry on the heap.
In VS2012, right-click on the project Properties, and select Code Analysis, then click the checkbox to Enable Code Analysis. It takes a few minutes to run.