File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Websphere and the fly likes Why does OutOfMemoryError cause Appserver to crash rather than just the application ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Why does OutOfMemoryError cause Appserver to crash rather than just the application ?" Watch "Why does OutOfMemoryError cause Appserver to crash rather than just the application ?" New topic
Author

Why does OutOfMemoryError cause Appserver to crash rather than just the application ?

Eddi Alfare
Greenhorn

Joined: Jan 10, 2010
Posts: 4
Hi,

can anyone explain to me why an OutOfMemoryException caused by a specific application, doesn't only cause that
application to crash, but also the entire appserver ?

this is the situation:

ClusterGroup_0
contains
Appserver_0 and Appserver_1
both running EAR_0 (and other EARS as well)

Now because a user requests a particularly large dataset, the EAR_0 application runs out of memory.
Result : ClusterGroup_0 crashes.

What I want is for only EAR_0 (the application) to crash, or - even better - only that particular user session.

Is this possible ?
Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
This error is thrown when the JVM cannot allocate an object because it is out of memory, and no more memory could be made available by the garbage collector.

The application servers in WebSphere run as separate JVMs or Java processes. So the process itself dies.

One should never try to catch such an error as generally it is almost impossible to recover from it. You will have to do some serious analysis to identify why this is happening.
Eddi Alfare
Greenhorn

Joined: Jan 10, 2010
Posts: 4
Thanks for the reply,

I was looking for a way to dynamically prevent OOME.
I wanted to implement an 'OutofMemoryERROR Warning System' as described in OOME Warning System,
but in stead of reacting to a pending OOME by increasing the PercentageUsageThreshold (at runtime), I wanted this system to find the culprit thread (which was allocating all these objects) and 'kill it'.
Is this feasible ?




Deepak Pant
Ranch Hand

Joined: Feb 13, 2004
Posts: 443
I am not very +ive about developing such a thing. I would rather focus on writing code that avoids out of memory issues. I have seen cases where the issue was in the underlying JRE instead of the application code. Based on app server you can work with the app server vendor or JRE vendor. Monitor GC logs and nail down the issue.

But do post a solution in case you develop something innovative.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why does OutOfMemoryError cause Appserver to crash rather than just the application ?
 
Similar Threads
Application Server Startup Problem
HttpSession and/or Container-managed authentication/authorization
Disadvantages of break and continue
how to detect Browser close
Singeton Question