Eli5-What does a “stack overflow” mean?

1.25K views

Eli5-What does a “stack overflow” mean?

In: 847

41 Answers

Anonymous 0 Comments

Imagine a really long parking lot that continues north effectively forever.

Spaces 1-1000 a reserved for trucks that run the parking lot. Other than that people can reserve spots to store trucks in for whatever jobs they do, coming and going as they please. As a general rule trucks that come in last will be the first to leave, but fancy programmers don’t have to follow this.

One day somebody reserves spaces 1200 to 1210, AND THEN brings in 11 trucks. When there are no more spaces and they park number 11 in somebody else’s reservation, that is stack overflow.
If the parking lot has protections against this, somebody will run out screaming “Stop stop, somethings wrong. Take all the trucks out and make a new reservation! ”
If they don’t have protections against this then they’ll be free to park in 1211 and when the real 1211 (or another problematic reservation) shows up they’ll just push whatever is there out of the spot and be fine with that.

This in contrast to underflow, when somebody goes to get a truck and the reservation is empty.

You are viewing 1 out of 41 answers, click here to view all answers.