McQueeney.com
 

Tom's Blog

JavaOne update: Faster, lighter Java with Barcelona
Published by Tom | June 29, 2004 10:04 PM EDT |

Can you run multiple Java applications in one virtual machine to boost speed and reduce memory requirements? Apparently, engineers at Sun are trying to find a way to do this. And from this first JavaOne session I attended this morning, it sounds like this could happen in the next year or so.

This research effort at Sun is called Project Barcelona, being led by Grzegorz Czajkowski, a senior staff engineer at Sun. Sun wants a JVM to run multiple applications in order to:

  • Improve application startup time
  • Boost performance
  • Lower the memory footprint for Java apps.

Some fruits of Barcelona will be available in the new HotSpot JVM in J2SE 1.5. Those improvements will allow classes running in different JVMs to share some read-only data. But Grzegorz Czajkowski stressed that Barcelona still is a project, not a product. The first real product to allow multiple Java applications to run in the same JVM should come this fall in the Connected Limited Device Configuration of J2ME, he said.

The Barcelona project has created a Multitasking Virtual Machine. MVM works using a daemon process on Solaris, called the mserver, and acts as a central point of contact for all Java applications that want to run. The Java startup command becomes a short-running application to contact the mserver daemon, which starts the Java app within its single JVM. Pretty neat.

The current MVM shares common classes, bytecodes and some of the runtime system, Grzegorz Czajkowski said. The MVM is in charge of isolating the different applications to ensure they don't collide with each other, and that security constraints are still handled on an application level and don't run with the security permissions of the MVM. Here's the great news:

  • Application startup time is reduced by about 96% for non-GUI applications, 33% for GUIs.
  • Memory requirements shrink 30% to 50% for each application.
  • Runtime performance suffers only slightly. I think he said the MVM creates a performance overhead of only about 1%.

If Sun can make the MVM part of Java, our Java applications should become less of the memory hogs they are, and start up much faster. Can you imagine the day when Eclipse launches in a few seconds rather than after you've returned from your coffee break?


20040629 Tuesday June 29, 2004 Permalink Comments [2]
Comments:

This MVM doesn't sound like anything new. I did something like this a few years back and there have been several posts/articles on ways to run multiple programs in on e JVM, including a sort of client/server main class approach that on the first run, when a server (thus response) is not found (returned), it starts the server. If a server is found, it simply hands off its main class and classpath to the server which then executes it in a separate thread. Run this as a service/daemon and you are all set.

Posted by Kevin on July 01, 2004 at 03:09 AM EDT #

I think what Project Barcelona is trying to do is find a way to share a VM transparently among multiple applications. That means sharing classes/objects only when it's appropriate. If you have one VM and spawn a new thread for each static main class, that would share the VM and all loaded classes, wouldn't it? How would you separate classes that *need* to be separate, such as allowing each application to load its own log4j configuration (as an easy example). And how about ensuring that each application runs with the permissions of its owner and not the owner of the shared VM?

Posted by Tom McQueeney on July 01, 2004 at 05:30 PM EDT
Website: http://mcqueeney.com/ #

Comments are closed for this entry.