Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Effect of StackOverflow error on server

 
Salil Surendran
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Was wondering if one of the requests to a web server results in StackOverflow error is the whole server shutdown or just the thread dies or an error is thrown back to the client?
 
Mansukhdeep Thind
Ranch Hand
Posts: 1158
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe it has to do with the stack that is maintained per Java Thread launched inside the JVM. Read this troubleshooting report I don't think it affects the whole web server as such.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Generally I find that such errors hose the entire JVM and the server is toast.
 
Mansukhdeep Thind
Ranch Hand
Posts: 1158
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear Bibeault wrote:Generally I find that such errors hose the entire JVM and the server is toast.


But why should it affect the underlying web server Bear? If a standalone Java application halts due to the same error, the underlying platform or OS remains unaffected.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have no interest in the theoretical. In practice, I have observed that when the code hits any kind of memory error, especially PermGen errors, that the server is wedged.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18214
53
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stack Overflow most commonly occurs when you have an infinite recursion loop. It will cause the thread that recurses to fail, but the rest of the system will usually continue on.

PermGen space issues are a different bucket of toads, however. Once you get one of them, you are pretty much doomed.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64971
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that's been my experience. Not sure if Ive ever run up against a stack overflow due to a recursion bug though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic