skip to main content
article

An adaptive, region-based allocator for java

Published: 20 June 2002 Publication History

Abstract

This paper introduces an adaptive, region-based allocator for Java. The basic idea is to allocate non-escaping objects in local regions, which are allocated and freed in conjunction with their associated stack frames. By releasing memory associated with these stack frames, the burden on the garbage collector is reduced, possibly resulting in fewer collections.The novelty of our approach is that it does not require static escape analysis, programmer annotations, or special type systems. The approach is transparent to the Java programmer and relatively simple to add to an existing JVM. The system starts by assuming that all allocated objects are local to their stack region, and then catches escaping objects via write barriers. When an object is caught escaping, its associated allocation site is marked as a non-local site, so that subsequent allocations will be put directly in the global region. Thus, as execution proceeds, only those allocation sites that are likely to produce non-escaping objects are allocated to their local stack region.The paper presents the overall idea, and then provides details of a specific design and implementation. In particular, we present a region-based allocator and the necessary modifications of the Jikes RVM baseline JIT and a copying collector. Our experimental study evaluates the idea using the SPEC JVM98 benchmarks, plus one other large benchmark. We show that a region-based allocator is a reasonable choice, that overheads can be kept low, and that the adaptive system is successful at finding local regions that contain no escaping objects.

References

[1]
B. Alpern, C. R. Attanasio, J. J. Barton, M. G. Burke, P. Cheng, J.-D. Choi, A. Cocchi, S. J. Fink, D. Grove, M. Hind, S. F. Hummel, D. Lieber, V. Litvinov, M. F. Mergen, T. Ngo, J. R. Russell, V. Sarkar, M. J. Serrano, J. C. Shepherd, S. E. Smith, V. C. Sreedhar, H. Srinivasan, and J. Whaley. The Jalapeño Virtual Machine. IBM Systems Journal, 39(1):211--238, February 2000]]
[2]
K. Arnold, J. Gosling, and D. Holmes. The Java Programming Language (Third Edition). Addison-Wesley, 2000]]
[3]
D. F. Bacon, R. B. Konuru, C. Murthy, and M. J. Serrano. Thin Locks: Featherweight Synchronization for Java. In Proceedings of the 1998 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 258--268, June 1998]]
[4]
B. Blanchet. Escape Analysis for Object Oriented Languages: Application to Java. In Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA'99), pages 20--34, Nov 1999]]
[5]
J.-D. Choi, M. Gupta, M. J. Serrano, V. C. Sreedhar, and S. P. Midkiff. Escape Analysis for Java. In Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA'99), pages 1--19, Nov 1999]]
[6]
D. Gay and A. Aiken. Memory Management with Explicit Regions. In Proceedings of the 1998 ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI), pages 313--323, Montreal, Canada, June 1998]]
[7]
D. Gay and A. Aiken. Language Support for Regions. In Proceedings of the ACM SIGPLAN '01 Conference on Programming Language Design and Implementation, pages 70--80, 2001]]
[8]
D. Gay and B. Steensgaard. Fast Escape Analysis and Stack Allocation for Object-based Programs. In Compiler Construction, 9th International Conference (CC 2000), pages 82--93, 2000]]
[9]
N. Hallenberg. Combining Garbage Collection and Region Inference in The ML Kit, 1999. Master's thesis. Department of Computer Science, University of Copenhagen, Denmark]]
[10]
T. Lindholm and F. Yellin. The Java Virtual Machine Specification. Addison-Wesley, 1996]]
[11]
C. McDowell. Reducing garbage in Java. http://www.cse.ucsc.edu/research/embedded/pubs/gc/]]
[12]
B. Steensgaard. Thread-Specific Heaps for Multi-Threaded Programs. ACM SIGPLAN Notices, 36(1):18--24, January 2000]]
[13]
M. Tofte. A Brief Introduction to Regions. ACM SIGPLAN Notices, 34(3):186--195, 1999]]
[14]
M. Tofte and J.-P. Talpin. Region-Based Memory Management. Information and Computation, 132(2):109--176, 1997]]
[15]
R. Vallee-Rai, E. Gagnon, L. Hendren, P. Lam, P. Pominville, and V. Sundaresan. Optimizing Java bytecode using the Soot framework: Is it feasible? In Compiler Construction, 9th International Conference (CC 2002), pages 18--34, 2000]]
[16]
J. Whaley and M. Rinard. Compositional Pointer and Escape Analysis for Java Programs. In Conference on Object-Oriented Programming, Systems, Languages and Applications (OOPSLA'99), pages 187--206, Nov 1999]]

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGPLAN Notices
ACM SIGPLAN Notices  Volume 38, Issue 2 supplement
MSP 2002 and ISMM 2002
February 2003
291 pages
ISSN:0362-1340
EISSN:1558-1160
DOI:10.1145/773039
Issue’s Table of Contents
  • cover image ACM Conferences
    ISMM '02: Proceedings of the 3rd international symposium on Memory management
    June 2002
    192 pages
    ISBN:1581135394
    DOI:10.1145/512429
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 20 June 2002
Published in SIGPLAN Volume 38, Issue 2 supplement

Check for updates

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)0
Reflects downloads up to 23 Dec 2024

Other Metrics

Citations

Cited By

View all

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media