Eli5-What does a “stack overflow” mean?

1.19K views

Eli5-What does a “stack overflow” mean?

In: 847

41 Answers

Anonymous 0 Comments

I’m a dad (operating system) and I am giving my son (a program) a cup for him to do whatever he wants with it. The cup is a container for anything really (“Memory”). My son can fill up the cup, mix liquids together, blow bubbles, drink – whatever. What he can’t do is put more liquid in the cup than the cup can hold – it will overflow and spill all over my carpet. When that happens, I take away the cup because he is a risk for spilling. In the same way you monitor your child to make sure he doesn’t overflow the bathtub or a cup, your OS is monitoring to make sure a program doesn’t go “out of bounds” with its resources. If it does, stop the program from doing what its doing and no more resources. There are different types of resources (stack vs heap) but this is my “5” answer and the others here do a good job explaining more in detail.

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