Lightweight Transparent Java Thread Migration for Distributed JVM
Wenzhang Zhu , Cho-Li Wang, and Francis C. M. Lau



A distributed JVM on clusters can provide a high-performance platform for running multi-threaded Java applications transparently. Efficient scheduling of Java threads among cluster nodes in a distributed JVM is desired for maintaining a balanced system workload so that the application can achieve maximum speedup. In the paper, we present a transparent thread migration system that is able to support high-performance native execution of multithreaded Java programs. We capitalize on the portability of the bytecode-oriented Java thread context to achieve portability of the corresponding native context at the lower level. To implement transparency of the migration, we perform dynamic native code instrumentation inside the JIT compiler. The mechanism has been successfully implemented and integrated in JESSICA2, a JIT-enabled distributed JVM, to enable automatic thread distribution and dynamic load balancing in a cluster environment.

We discuss issues related to supporting transparent Java thread migration in a JIT-enabled distributed JVM, and compare our solution with previous approaches that use static bytecode instrumentation and JVMDI. We also propose optimizations including dynamic register patching and pseudo-inlining that can reduce the runtime overhead incurred in a migration act. We use measured experimental results to show that our system is efficient and lightweight.