|
Maxine: Sun's New Research VM
Written entirely in Java, the Maxine virtual machine (VM) gives researchers a more productive way to explore new software technologies. August 13, 2008 - Over the last decade, innovation in Java virtual machine technology has become the main venue in the competition for ever increasing software performance and scalability. Industrial VMs, in particular Sun's Java HotSpot VM, host a vast array of complex functionality. Implementations of adaptive dynamic compilation, concurrent and parallel garbage collection and multi-threading with concurrency control have become enormously sophisticated. Such implementations often become entangled with one another in subtle ways, making it increasingly difficult to experiment with and extend any industrial VM. Nevertheless we must continue investigating new algorithms, techniques and data structures, not the least to keep up with and exploit ongoing hardware innovations, especially regarding multi-core CPUs and the memory hierarchy. Meanwhile, programmer education has shifted dramatically in favor of the Java platform and the question arises: why not create a research VM that is written in the Java language? Although Sun is not first to ask that question, Sun now finds itself in a unique position to deliver. Maxine: An Open Source VM for Java, Written in Java A team of researchers at Sun Labs has developed the Maxine VM, a virtual machine for the Java language, written in the Java language. Led by principal investigator Dr. Bernd Mathiske, the team believes the Maxine VM has the potential to greatly improve productivity reducing implementation timeframes and maintenance costs while giving researchers more flexibility to explore innovative technologies. The Maxine VM will be fully compliant with the genuine Java Development Kit (JDK) within the next few months and is already well-integrated with powerful development tools. It has been released as open source software and is freely downloadable at http://maxine.dev.java.net. "This is an exercise in improving productivity," said Dr. Mathiske. "There is a significant advantage simply in the fact that Maxine is written in Java, but you also get access to productivity-enhancing Java development tools. You can use NetBeans right out of the box, or IntelliJ, or JBuilder, or Eclipse, or others. Application developers have had access to best-in-class tools for years; we felt it was time to bring them to VM writers." Java-Powered: Write Everything Only Once Almost all of the source code for Maxine is written in Java 6 and integrates well with the JDK 6 release, so researchers can leverage Java Technology 5/6 features. All internal data structures are expressed by Java objects, and in contrast to non-bootstrapped VMs such as the Java HotSpot VM there is no need for object handles in VM code to guard against garbage collection. A key productivity advantage of Maxine is that VM developers can almost always Write Everything Only Once (WEOO). Maxine reuses runtime methods for different compilers by translation, so there is no manual re-implementation. Porting the VM is greatly expedited by confining changes to primitive operations and ABI specifics. Sun Labs is also open-sourcing a companion development tool: the Maxine Inspector is a combined serviceability agent, object browser, and debugger developed specially for the Maxine VM. The Inspector displays objects, class data structures, memory content, disassembled methods and execution state elements such as threads, register contents, and stack frames. It also provides metadata queries to look up specific classes, methods or translated versions of a method. The usual debugger functionality (single-step, step over, step out, run to instruction, resume, pause, breakpoints, etc.) is not only available for machine code, but simultaneously for Java bytecode as well. Soon, this multi-level debugging will also include Java source code. "The Maxine VM and the Inspector share not only the same implementation language but also the same code base," said Dr. Mathiske. "There is a lot of reuse between the VM and the Inspector." Pervasively Meta-Circular VM Design The Maxine VM maximizes the use of meta-circularity in its design. Not only is the VM written in the same language it executes, but the VM also uses JDK packages and implements their downcalls into the VM in the same language. Furthermore, Maxine is built around an optimizing compiler, not an interpreter, and the optimizing compiler in the VM translates itself. "Again, the big payoff is productivity," said Dr. Mathiske. "We have created a way to disentangle the interrelationships among VM features. Because of the pervasive use of meta-circular design, it is now possible for a small team to make a small investment in VM development and get big results." According to Dr. Mathiske, the Maxine VM has also demonstrated potential for high performance, and his team as well as the Maxine open source community is working toward performance enhancements. "Ultimately, the target is to compete with even commercial product quality in terms of performance," he said. "We believe it is possible to write a very fast VM in the Java language."
Flexible, Configurable VM The majority of open source projects create "black box" software, with specific functionality that is used for specific purposes. It is the functionality of such software that is of interest, not the internal design of the software. Maxine, on the other hand, is intended to be a "white box" system whose internal design is of the greatest interest. Maxine users modify and experiment with the VM in order to produce interesting research results. Thus flexibility and configurability were more important design criteria to the Maxine team than any specific functionality. Maxine currently offers a wide range of configurable components. At VM build time, researchers can select which alternative packages to load for a particular "Scheme." In each package a designated class implements the given Scheme interface. The class is then loaded, initialized, and instantiated. Currently, the following configurable components (Schemes) are available:
Maxine: Simplify, Accelerate, Innovate. Maxine has recently been released as open source software, and there is much work to be done. The Sun Labs team is continuing its efforts to expand Maxine's functionality, performance, and roster of supported platforms. It will also be up to the Maxine community to contribute to the innovation and build on the foundation that Sun Labs has created. "We think Maxine will be useful for a large number of researchers and VM developers as a great new tool for discoveries in software technology," said Dr. Mathiske. "It's all about accelerating advances in the Java platform by fostering systems programming in Java." For more information about Maxine, visit maxine.dev.java.net. | |||||||||||||||||||||||