Overcoming JVM HotSwap constraints via binary rewriting

Dong Kwan Kim, Eli Tilevich · 2008

Java HotSpot VM provides a facility for replacing classes at runtime called HotSwap. One design property of HotSwap is that the signature of a replaced class must remain the same between different versions, which significantly constrains the programmer modifying a class to be replaced. Specifically, the programmer is precluded from adding new methods, constructors, or fields, or even changing the signatures of existing methods or fields. This paper presents a novel approach that overcomes these constraints of HotSwap by using binary refactoring, a technique that rewrites the binary representation of a program without affecting its functionality. A series of micro and macro benchmarks we conducted demonstrate that the approach is extensible and efficient. In particular, the new binary refactoring technique, which enables the approach, produces highly-efficient refactored application versions, outperforming a widely-used prior technique by as much as an order of magnitude. These initial results indicate that by rewriting the bytecode of a swapped program, one can effectively overcome constraints of HotSwap with minimal performance overhead.

Read the paper · More papers on PaperTik