aspose file tools*
The moose likes Servlets and the fly likes Effect of StackOverflow error on server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Effect of StackOverflow error on server" Watch "Effect of StackOverflow error on server" New topic
Author

Effect of StackOverflow error on server

Salil Surendran
Ranch Hand

Joined: Jan 16, 2004
Posts: 39
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?


Thanks,<br />Salil Surendran
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

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.


~ Mansukh
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

Generally I find that such errors hose the entire JVM and the server is toast.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

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

Joined: Jan 10, 2002
Posts: 61658
    
  67

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

Joined: Jun 25, 2001
Posts: 16250
    
  21

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.


Customer surveys are for companies who didn't pay proper attention to begin with.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61658
    
  67

Yes, that's been my experience. Not sure if Ive ever run up against a stack overflow due to a recursion bug though.
 
 
subject: Effect of StackOverflow error on server