JDK-4187333 : let multiple VMs share code & constant pools
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.2.0,1.3.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS:
    generic,solaris_8,windows_95,windows_98,windows_nt generic,solaris_8,windows_95,windows_98,windows_nt
  • CPU: generic,x86
  • Submitted: 1998-11-05
  • Updated: 2002-07-22
  • Resolved: 2002-07-22
Related Reports
Duplicate :  
Duplicate :  
Description

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)
======================================================================

Comments
EVALUATION fred.oliver@East 2001-06-27 In progress. ###@###.### 2002-07-22 This bug is being closed as a duplicate of 4416624, which describes sharing of class descriptions (including constant pools) between Java processes. Work is being done on "Virtual machine architectures for scalable and safe execution of multiple applications written in the Java programming language".
11-06-2004