Generating object lifetime traces with Merlin

Matthew Hertz*, Stephen M. Blackburn, J. Eliot B. Moss, Kathryn S. McKinley, Darko Stefanovic

*Corresponding author for this work

    Research output: Contribution to journalArticlepeer-review

    42 Citations (Scopus)

    Abstract

    Programmers are writing a rapidly growing number of programs in object-oriented languages, such as Java and C#, that require garbage collection. Garbage collection traces and simulation speed up research by enabling deeper understandings of object lifetime behavior and quick exploration and design of new garbage collection algorithms. When generating perfect traces, the brute-force method of computing object lifetimes requires a whole-heap garbage collection at every potential collection point in the program. Because this process is prohibitively expensive, researchers often use granulated traces by collecting only periodically, for example, every 32 KB of allocation. We extend the state of the art for simulating garbage collection algorithms in two ways. First, we develop a systematic methodology for simulation studies of copying garbage collection and present results showing the effects of trace granularity on these simulations. We show that trace granularity often distorts simulated garbage collection results compared with perfect traces. Second, we present and measure the performance of a new algorithm called Merlin for computing object lifetimes. Merlin timeatamps objects and later uses the timestamps of dead objects to reconstruct when they died. The Merlin algorithm piggybacks on garbage collections performed by the base system. Experimental results show that Merlin can generate traces over two orders of magnitude faster than the brute-force method which collects after every object allocation. We also use Merlin to produce visualizations of heap behavior that expose new object lifetime behaviors.

    Original languageEnglish
    Pages (from-to)476-516
    Number of pages41
    JournalACM Transactions on Programming Languages and Systems
    Volume28
    Issue number3
    DOIs
    Publication statusPublished - 2006

    Fingerprint

    Dive into the research topics of 'Generating object lifetime traces with Merlin'. Together they form a unique fingerprint.

    Cite this