Name: ap32198 Date: 11/04/98
I think that by Java 1.3 (or 2.0, or whatever...)
running Java programs will be common enough that
the current totally-separate-vm-for-each-program
will become inadequate. In fact, I already find
it extremely difficult to run more than two Swing
programs at the same time, because each VM loads
(and compiles, etc.) its own totally separate
copy of the core classes. Since Java is by now
effectively a lightweight operating system,
having to load a separate copy for each program
is bothersome. I propose that in the next
release of Java, launching any VM beyond the
first one simply "tie in" to the already-
running VM, that is, typing the "java" command
would mean "start the VM if it isn't already,
or command the existing VM to spawn a new
(lightweight) VM if it is". (This isn't unusual
-- on Windows, at least, double-clicking on
the Netscape icon while Netscape is running will
simply launch a new browser window rather than
a totally sepearate copy of the program). It
will make running multiple Java programs very
cheap, in fact cheaper than running multiple
native programs, because Java programs have no
overhead other than the core classes.
Naturally, it would be quite a bit of work to
ensure that two "lightweight" vm's have the
exact same behavior as two "heavyweight" vm's
(each has a separate copy of all static variables,
etc.) but I think it's worth the effort.
It certainly makes sense for an all-Java
operating system to simply be able to spawn
a new Java VM to run a program in, while sharing
all of its core classes/constant pool (please
have a public API for this!).
I would also expect this to reduce the startup
time associated with the JDK tools, such as
javac, as long as a VM is already running (and
you should probably include a new parameter on
the java command, maybe -persist, that means
"hang around indefinitely" so we could just start
one VM and then every invocation of every Java
program would have zero startup cost). Let
Microsoft chew on that one!
(Review ID: 39273)
======================================================================
- duplicates
-
JDK-4172686 Keep the VM running / cleanup & reload application or applet
-
- Closed
-
-
JDK-4416624 multiple JVM runtimes do not share memory between themselves
-
- Closed
-