Has anyone ever encountered the InsufficientExecutionStackException? MSDN doesn't tell much about it.
What is the difference between the InsufficientExecutionStackException and the StackOverflowException?
This exception is thrown by RuntimeHelpers.EnsureSufficientExecutionStack. See https://msdn.microsoft.com/library/system.runtime.compilerservices.runtimehelpers.ensuresufficientexecutionstack.aspx
In contrast to a StackOverflowException you can catch a InsufficientExecutionStackException and handle the situation gracefully.
From CLR Via C#
Just before invoking a method, you could check for ample stack space by calling the RuntimeHelper class’s EnsureSufficientExecutionStack method This method checks if the calling thread has enough stack space available to execute the average
method (which is not well defned) If there is insuffcient stack space, the method throws an InsufficientExecutionStackException which you can catch The EnsureSufficientExecutionStack method takes no arguments and returns void This method is typically used by recursive methods
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With