Space- and time-efficient implementation of the Java object model

40Citations
Citations of this article
34Readers
Mendeley users who have this article in their library.
Get full text

Abstract

While many object-oriented languages impose space overhead of only one word per object to support features like virtual method dispatch, Java’s richer functionality has led to implementations that require two or three header words per object. This space overhead increases memory usage and attendant garbage collection costs, reduces cache locality, and constrains programmers who might naturally solve a problem by using large numbers of small objects. In this paper, we show that with careful engineering, a high-performance virtual machine can instantiate most Java objects with only a single-word object header. The single header word provides fast access to the virtual method table, allowing for quick method invocation. The implementation represents other per-object data (lock state, hash code, and garbage collection flags) using heuristic compression techniques. The heuristic retains two-word headers, containing thin lock state, only for objects that have synchronized methods. We describe the implementation of various object models in the IBM Jikes Research Virtual Machine, by introducing a pluggable object model abstraction into the virtual machine implementation. We compare an object model with a two-word header with three different object models with single-word headers. Experimental results show that the object header compression techniques give a mean space savings of 7%, with savings of up to 21%. Compared to the two-word headers, the compressed space-encodings result in application speedups ranging from −1.5% to +2.2%. Performance on synthetic micro-benchmarks ranges from +23% due to benefits from reduced object size, to −12% on a stress test of virtual method invocation.

Cite

CITATION STYLE

APA

Bacon, D. F., Fink, S. J., & Grove, D. (2002). Space- and time-efficient implementation of the Java object model. In Lecture Notes in Computer Science (including subseries Lecture Notes in Artificial Intelligence and Lecture Notes in Bioinformatics) (Vol. 2374, pp. 111–132). Springer Verlag. https://doi.org/10.1007/3-540-47993-7_5

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free