[Isolate-interest] JNI, RMI, and Processes
Curt Cox
ccox@tripos.com
Wed, 11 Feb 2004 09:56:06 -0600
Hi All,
In the upcoming JSR-121 reference implementation, will the
crash of an isolate take down an entire aggregate?
Here's my situation. There is a Java application that uses
JNI for some numerical computation. Porting the native code
to Java is far too big of a job to be realistic.
Unfortunately a bug in the native code can take down the
entire process, JVM and all. The solution that I've adopted
for is to create a separate sacrificial JVM just for JNI.
The main JVM calls the sacrificial JVM via RMI, which
invokes the routines via JNI and returns the results.
If the sacrificial JVM crashes, the main JVM just starts a
new one. Despite worries from my peers about the extra
overhead, there is no noticeable slowdown, and a JVM created
for just this purpose doesn't take much RAM.
So, would this scheme work with the upcoming JSR-121
reference implementation?
I was hoping to eventually use an isolate for the sacrificial
JVMs because there currently isn't any simple way to create
another JVM from an existing one. Most methods don't work
in all circumstances. Consider:
- java may not be installed
- if a JVM tries to create another, it probably wants the same
JRE version as it, instead of the installed default
- it should work on all platforms
- it should work from a webstarted program
Thanks,
Curt