nyu-econ-370
nyu-econ-370 copied to clipboard
What is a ``stackoverflow``?
Great Question!
Not Part of the Course
A stack overflow is usually used in reference to the C programming language and describes a condition whereby a program overflows the C memory stack. This usually involves a program crash condition as the program is trying to access or use memory it is not permitted to do so.
This is related to the infinite or very deep recursion problem as it is a common cause of the stack overflow condition. Eventually the computer would run out of space on the stack and enter an overflow condition. The stack is a piece of memory that is reserved for the use of local variables and function returns.
Python puts protections in place to prevent this from happening - but you can actually alter that behavior using:
import sys
sys.setrecursionlimit(N) #Where N is larger than what your system can handle (Depents on Hardware)
But in most cases this is generally a bad idea.