Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does getting a stack overflow only affect the thread it happened in?

Tags:

java

To put it in context : So lets say I was playing an online game and I created a stack overflow. Would that effect everyone on the server playing as well, or just me?

like image 767
Moraki Avatar asked May 21 '26 23:05

Moraki


1 Answers

If the JVM is on your browser, definitely not.

On the server, a stack overflow will effectively kill the thread. If it is missing finally blocks the thread might die without releasing resources which could wedge the server after a while, but it should release all mutexes held due to synchonized blocks. Assuming the error is not handled, it will call the thead's ThreadUncaughtExceptionHandler which normally will not take down the server unless the server is doing work in the main thread, but an uncaught exception handler could be implemented to take down the server.

like image 144
Mike Samuel Avatar answered May 24 '26 13:05

Mike Samuel



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!