Profile-driven Code Unloading for Resource-Constrained JVMs

Lingli Zhang and Chandra Krintz


Java virtual machines (JVMs) have become increasingly popular for execution of a wide range of applications on mobile and embedded devices. Most JVMs for such devices execute programs using interpretation. However, JVMs that use dynamic compilation have been shown to enable significant performance improvements. A disadvantage of a compile-only approach in resource-constrained environments is that it uses more memory than interpretation to store compiled code for reuse.

In this paper, we address this limitation with techniques that attempt to automatically unload dead or infrequently used native code to reduce the memory footprint of a compile-only JVM. We describe a number of profile-based strategies that identify unloading candidates. Our empirical evaluation, using a number of common benchmarks, indicates that dynamic code unloading can reduce code size significantly with negligible overhead. When memory is highly constrained, this reduction translates into significant execution time benefits for the benchmarks, JVM, and JVM configuration that we investigated.