However The current C# compiler does not achieve this. Each method call frame (activation record) is kept on the stack memory.
And After nearly 80,000 invocations, the stack memory space is exhausted and the program terminates.
Info Usually, the StackOverflowException is caused by an infinite or uncontrolled recursion.
static void Recursive(int value)
// Write call number and call this method again.
// ... The stack will eventually overflow.
static void Main()
// Begin the infinite recursion.Recursive(0);
Process is terminated due to StackOverflowException.
Exception message. The message "Process is terminated" is displayed. If you wrap the initial call to Recursive in a try-catch block, you cannot catch the StackOverflowException.