shared library issues

Stéphane Konstantaropoulos stephane@cs.york.ac.uk
Mon May 2 22:57:00 GMT 2005


Le lundi 02 mai 2005 à 12:40 -0400, Bryce McKinlay a écrit :
> Thomas Fitzsimmons wrote:
> 
> >> I'd like to use libgcj directly as
> >>a shared object and for this I have a couple of questions:
> >>
> >>- Is it possible to initialize and shutdown the JVM without exiting the
> >>calling program?
> >>
> >Yes, using CreateJavaVM and DestroyJavaVM.
> >  
> >
> DestroyJavaVM is not yet implemented.
> 

That's what I was worried about.

> >>- Is it possible to have multiple instances of the JVM in the same
> >>process?
> >>
> >
> >Yes, although if you're running AWT programs you may encounter problems
> >initializing the GLib main loop multiple times.
> >  
> >
> Actually, no, you can't. You can call CreateJavaVM multiple times, but 
> it won't actually create isolated, distinct runtimes.
> 
> Bryce
> 

Ok, the problem of having only one JVM runtime in-process can be
circumvented easily enough (in my mind design of the software)

But not being able to leave the VM is more disturbing and this is what
happens with Sun's plugin, it calls "java_vm" when Java is needed by
Gecko but then never seems to clean up when Java is no longer needed.
This is a memory killer, Gecko is already quite heavy if Java stays
loaded all the time we end up with a heavyweight browser.

Would there be no way to do some - more dirty - thing like: dlopen
libgcj and dlclose it when no longer needed? Don't think this could work
as we would need the resources taken up by libgcj to be freed in some
way.

Anybody got an idea?

And, yes Tom, I looked at gcjwebplugin, it is nice but it is not what I
am doing. We are focusing on security in Open Source Java and the plugin
is according to me a good starting point for an experiment. This is
experimental work and for our purposes we have to start from zero and
specify everything as we go.

Cheers,

-- 
Stéphane Konstantaropoulos
- Research Student, Computer Science
-- University of York, http://www-users.cs.york.ac.uk/~stephane
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/java/attachments/20050502/43134883/attachment.sig>


More information about the Java mailing list