Dynamic Code Evolution for Java

Thomas Würthinger
Institute for System Software

Christian Wimmer
University of California, Irvine

Lukas Stadler
Institute for System Software

In Proceedings of the International Conference on Principles and Practice of Programming in Java, pages 10–19. ACM Press, 2010. doi:10.1145/1852761.1852764


Dynamic code evolution is a technique to update a program while it is running. In an object-oriented language such as Java, this can be seen as replacing a set of classes by new versions. We modified an existing high-performance virtual machine to allow arbitrary changes to the definition of loaded classes. Besides adding and deleting fields and methods, we also allow any kind of changes to the class and interface hierarchy. Our approach focuses on increasing developer productivity during debugging. Changes can be applied at any point a Java program can be suspended. The evaluation section shows that our modifications to the virtual machine have no negative performance impact on normal program execution. The fast in-place instance update algorithm ensures that the performance characteristics of a change are comparable with performing a full garbage collection run. Standard Java development environments are capable of using the code evolution features of our modified virtual machine, so no additional tools are required.

Download as PDF

© ACM, 2010. This is the author’s version of the work. It is posted here for your personal use. Not for redistribution.