470,849 Members | 1,084 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,849 developers. It's quick & easy.

OutOfMemoryError - Any Way to Exit JVM?

Hi all,

We're having a major problem keeping Java calculators (that were
written by a third party vendor) alive. They leak memory and
eventually cause OutOfMemoryErrors. We cannot address the problem
directly until the vendor does, so we need to manage these dying
calculators.

Unfortunately, they are all started in separate processes and an
OutOfMemory error seems to kill *only* the thread, NOT the JVM. Is
there a way to ensure that the JVM dies as well?

My real hope is that some JVM has a command line option to kill the
whole thing when it has an allocation error. Otherwise, perhaps we can
add another thread to the process that watches it, but that's harder.

Any help would be greatly appreciated.

Thanks,
Steve Lieberman
Jul 17 '05 #1
4 5587
Steve Lieberman wrote:
Hi all,

We're having a major problem keeping Java calculators (that were
written by a third party vendor) alive. They leak memory and
eventually cause OutOfMemoryErrors. We cannot address the problem
directly until the vendor does, so we need to manage these dying
calculators.

Unfortunately, they are all started in separate processes and an
OutOfMemory error seems to kill *only* the thread, NOT the JVM. Is
there a way to ensure that the JVM dies as well?

My real hope is that some JVM has a command line option to kill the
whole thing when it has an allocation error. Otherwise, perhaps we can
add another thread to the process that watches it, but that's harder.

Steve,

We tried doing this once. Eventually we came to the conclusion that it
was a foolish quest. Once an OutOfMemoryError occurs, nothing in the JVM
is trustworthy. The only safe thing to do at that point is to exit.

Regards,
Kenneth
Jul 17 '05 #2
Kenneth Stephen wrote:
Steve Lieberman wrote:
Hi all,

We're having a major problem keeping Java calculators (that were
written by a third party vendor) alive. They leak memory and
eventually cause OutOfMemoryErrors. We cannot address the problem
directly until the vendor does, so we need to manage these dying
calculators.

Unfortunately, they are all started in separate processes and an
OutOfMemory error seems to kill *only* the thread, NOT the JVM. Is
there a way to ensure that the JVM dies as well?

My real hope is that some JVM has a command line option to kill the
whole thing when it has an allocation error. Otherwise, perhaps we can
add another thread to the process that watches it, but that's harder.

Steve,

My apologies. I just reread your question and I realize that I didnt
address your problem. Doesnt System.exit work for you?

Regards,
Kenneth
Jul 17 '05 #3
Kenneth Stephen <ma**********************@gmail.com> wrote in message news:<3I******************@fe2.texas.rr.com>...

My apologies. I just reread your question and I realize that I didnt
address your problem. Doesnt System.exit work for you?

The problem is that the code for this dying process belongs to another
group. Is there a way to add a thread that watches for
OutOfMemoryErrors, or, even better, some way to cause the process to
die w/o even adding code at all?

Thanks,
Steve
Jul 17 '05 #4
Steve Lieberman wrote:
Kenneth Stephen <ma**********************@gmail.com> wrote in message news:<3I******************@fe2.texas.rr.com>...
My apologies. I just reread your question and I realize that I didnt
address your problem. Doesnt System.exit work for you?


The problem is that the code for this dying process belongs to another
group. Is there a way to add a thread that watches for
OutOfMemoryErrors, or, even better, some way to cause the process to
die w/o even adding code at all?


You might be able to get some mileage out of the remote debugging API.

HTH,
Ray

--
XML is the programmer's duct tape.
Jul 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Nagaraj | last post: by
1 post views Thread by novel | last post: by
1 post views Thread by Guinness Mann | last post: by
bhing
2 posts views Thread by bhing | last post: by
6 posts views Thread by nickyeng | last post: by
1 post views Thread by HxRLxY | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.