title: How to prevent a stack overflow by monitoring the stack size?
body: <p>Many C/C++/Fortran and other programmers would have come across "stack overflow" errors.
  My question is, Is there a tool, a program or a simple code snippet, that allow us to monitor or check the size of the stack while the program is running? This may be helpful to pinpoint where the stack is being accumulated and eventually causing overflow.</p>