Myths and Realities: The Performance Impact of Garbage Collection

Date

2004

Authors

Blackburn, Stephen
Cheng, Perry
McKinley, Kathryn

Journal Title

Journal ISSN

Volume Title

Publisher

Association for Computing Machinery Inc (ACM)

Abstract

This paper explores and quantifies garbage collection behavior for three whole heap collectors and generational counterparts: copying semi-space, mark-sweep, and reference counting, the canonical algorithms from which essentially all other collection algorithms are derived. Efficient implementations in MMTk, a Java memory management toolkit, in IBM's Jikes RVM share all common mechanisms to provide a clean experimental platform. Instrumentation separates collector and program behavior, and performance counters measure timing and memory behavior on three architectures. Our experimental design reveals key algorithmic features and how they match program characteristics to explain the direct and indirect costs of garbage collection as a function of heap size on the SPEC JVM benchmarks. For example, we find that the contiguous allocation of copying collectors attains significant locality benefits over free-list allocators. The reduced collection costs of the generational algorithms together with the locality benefit of contiguous allocation motivates a copying nursery for newly allocated objects. These benefits dominate the overheads of generational collectors compared with non-generational and no collection, disputing the myth that "no garbage collection is good garbage collection." Performance is less sensitive to the mature space collection algorithm in our benchmarks. However the locality and pointer mutation characteristics for a given program occasionally prefer copying or mark-sweep. This study is unique in its breadth of garbage collection algorithms and its depth of analysis.

Description

Keywords

Keywords: Algorithms; Benchmarking; Computer architecture; Computer hardware; Costs; Java programming language; Mark-sweep; Memory management; Reference counting; Semi-spaces; Data storage equipment Generational; Java; Mark-sweep; Reference counting; Semi-space

Citation

Source

Joint Internaional Conference on Measurement and Modeling of Computer Systems, Proceedings.

Type

Conference paper

Book Title

Entity type

Access Statement

License Rights

DOI

Restricted until