JamVM
Latest version is JamVM 1.5.1, released on 10th March 2008. See the
release
notes for the changes since 1.5.0.
JamVM is a new Java Virtual Machine which conforms to the JVM
specification version 2 (blue book). In comparison to most other
VM's (free and commercial) it is extremely small, with a stripped
executable on PowerPC of only ~200K, and Intel 180K. However, unlike
other small VMs (e.g. KVM) it is designed to support the full
specification, and includes support for object finalisation,
Soft/Weak/Phantom References, class-unloading, the
Java Native Interface (JNI) and the Reflection API.
You can download the latest release of JamVM from the
download area
or have a look at the project
summary page.
This contains links to the public forums and facilities for bug
reporting and feature requests.
I welcome feedback of any kind, e.g. bug reports, suggestions, etc. I'm always
interested to hear how and if people are using JamVM so even if you don't have
a problem drop me an email (email address at the bottom).
Supported Platforms
JamVM currently only includes an interpreter (keeps it small). However, the
interpreter is highly optimised, and performance is on par with a simple JIT.
As most of the code is written in C it is easy to port to new architectures.
So far, JamVM supports and has been tested on the following OS/architectures :
Linux
- PowerPC: for many years my main platform, so this is well tested.
Built and tested on G3 and G4 systems.
- i386: built and tested on i586, i686 (Pentium III), Pentium 4,
Athlon and Core 2 Duo. At least an i486 is needed because
JamVM uses the
cmpxchg instruction, which was first introduced
on the i486.
- ARM: Originally ported and tested on the iPAQ running Linux (3950,
with xscale PXA250 processor, though it should work on StrongARM).
Later development on Neo1973 (ARM920T core). Little and Big Endian
machines are supported, soft/kernel FP emulation, and OABI or
EABI.
- AMD64: built and tested on AMD Athlon 64, Pentium 4 and Core 2 Duo
(using EM64T).
- MIPS: built and tested on mipsel using the O32 ABI.
Mac OS X/Darwin
- PowerPC: built and tested on Mac OS X 10.3 (Panther),
and 10.4 (Tiger), where it works "out-of-the-box". It should also work on 10.2 (Jaguar)
but you may need to install Fink. Testing has been on G3, G4 and G5 systems.
- PowerPC64: built and tested as a 64-bit executable on G5.
- i386: JamVM has been built and tested on the Apple MacBook Pro
(Intel Core Duo and Core 2 Duo).
- ARM: built using unofficial toolchain and tested on a jailbroken
iPhone.
JamVM may work on
other Unix (or Unix-like) systems with the above processors "as is" as long
as they support Posix threads, but I haven't tested.
Class Libraries
JamVM is designed to use the
GNU Classpath
Java class library. A number of classes are
reference classes which must be modified for a particular VM. These are
provided along with JamVM (see INSTALL). JamVM should always work with
the latest development snapshot of Classpath (currently 0.97). It
should also work with the latest version direct from CVS (but check the
Classpath mailing lists for possible patches). Later snapshots of Classpath
may also work, if no modifications have been made to the VM interface.
Note, JamVM will not work with the class library from Sun or IBM's Virtual Machines or
OpenJDK.
Building and Installing
You can download the latest release of JamVM from the
download area.
This contains a README and an INSTALL file, containing full instructions.
JamVM "Features"
For those interested in the design of virtual machines, JamVM includes a number
of optimisations to improve speed and reduce foot-print. A list, in no
particular order, is given below.
- Execution engine supports many levels of optimisation from basic switched
interpreter to inline-threaded interpreter with stack-caching (equivalent
performance to a simple JIT).
- Uses native threading (posix threads). Full thread implementation
including
Thread.interrupt()
- Object references are direct pointers (i.e. no handles)
- Supports class loaders
- Efficient thin locks for fast locking in uncontended cases (the
majority of locking) without using spin-locking
- Two word object header to minimise heap overhead (lock word and
class pointer)
- Execution engine supports basic switched interpreter and threaded
interpreter, to minimise dispatch overhead (requires gcc value labels)
- Stop-the-world mark and sweep garbage collector
- Thread suspension uses signals to reduce suspend latency and improve
performance (no suspension checks during normal execution)
- Full object finalisation support within the garbage collector
(with finaliser thread)
- Full support for Soft/Weak/Phantom References (with Reference
Handler thread)
- Full support for class and class-loader garbage-collection and unloading
(including associated shared libraries)
- Garbage collector can run synchronously or asynchronously within its
own thread
- String constants within class files are stored in hash table to
minimise class data overhead (string constants shared between all
classes)
- Supports JNI and dynamic loading for use with standard libraries
- Uses its own lightweight native interface for internal native methods
without overhead of JNI
- JamVM is written in C, with a small amount of platform dependent
assembler, and is easily portable to other architectures.
That's it!
Robert Lougher
10th March 2008.
rob at lougher.org.uk
rlougher at users.sf.net