473,399 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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 5722
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Nagaraj | last post by:
I have a RMIServer which reads a XML file during the startup after registering with the rmi registry.When the XML file is too huge I get the java.lang.OutOfMemoryError.But after this error is...
1
by: novel | last post by:
Hi, i wrote a java program, that create a rdf file parsing a file tree. On the last step the shockwaves and gifs are checked and the byte sizes are written in the rdf file as nodes. The 1....
1
by: Guinness Mann | last post by:
Pardon me if this is not the optimum newsgroup for this post, but it's the only .NET newsgroup I read and I'm certain someone here can help me. I have a C# program that checks for an error...
2
bhing
by: bhing | last post by:
Hiya!!! Please help me on this, we have a website running under linux with JSP and Apache-tomcat ... when we try to upload and edit something it returns out of memory, and suddenly tomcat will...
0
by: subashinicse | last post by:
hi everybody, am working with J2EE &hibernate... while i run my application,am sending an object(filetype of size more than 8MB) from jboss to securityserver,where am getting ERROR as...
0
by: subashinicse | last post by:
hi everybody, am working with J2EE &hibernate... while i run my application,am sending an object(filetype of size more than 8MB) from jboss to securityserver,where am getting ERROR as...
6
by: nickyeng | last post by:
I keep getting this error: java.lang.OutOfMemoryError: Java heap space what possible reason that cause this error ? My boss dont want increase java memory, so i had to change my code. ...
1
by: HxRLxY | last post by:
I have a program that shows a thumbnail of an image. If the user clicks on the thumbnail a new JFrame is opened that shows the full size image. If the image is larger than the screen, it gets...
8
blazedaces
by: blazedaces | last post by:
So I have a program below which writes an excel file with multiple sheets based on inputs of sheet names, data, cell types, etc. It uses Apache POI, which is currently the only thing I found...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.