Garbage Collection is Fast, But a Stack is Faster

Prompted by claims that garbage collection can outperform stack allocation when sufficient physical memory is available, we present a careful analysis and set of cross-architecture measurements comparing these two approaches for the implementation of continuation (procedure call) frames. When the fr...

Full description

Bibliographic Details
Main Authors: Miller, James S., Rozas, Guillermo J.
Language:en_US
Published: 2004
Online Access:http://hdl.handle.net/1721.1/6622
_version_ 1826201251268788224
author Miller, James S.
Rozas, Guillermo J.
author_facet Miller, James S.
Rozas, Guillermo J.
author_sort Miller, James S.
collection MIT
description Prompted by claims that garbage collection can outperform stack allocation when sufficient physical memory is available, we present a careful analysis and set of cross-architecture measurements comparing these two approaches for the implementation of continuation (procedure call) frames. When the frames are allocated on a heap they require additional space, increase the amount of data transferred between memory and registers, and, on current architectures, require more instructions. We find that stack allocation of continuation frames outperforms heap allocation in some cases by almost a factor of three. Thus, stacks remain an important implementation technique for procedure calls, even in the presence of an efficient, compacting garbage collector and large amounts of memory.
first_indexed 2024-09-23T11:48:40Z
id mit-1721.1/6622
institution Massachusetts Institute of Technology
language en_US
last_indexed 2024-09-23T11:48:40Z
publishDate 2004
record_format dspace
spelling mit-1721.1/66222019-04-11T02:52:34Z Garbage Collection is Fast, But a Stack is Faster Miller, James S. Rozas, Guillermo J. Prompted by claims that garbage collection can outperform stack allocation when sufficient physical memory is available, we present a careful analysis and set of cross-architecture measurements comparing these two approaches for the implementation of continuation (procedure call) frames. When the frames are allocated on a heap they require additional space, increase the amount of data transferred between memory and registers, and, on current architectures, require more instructions. We find that stack allocation of continuation frames outperforms heap allocation in some cases by almost a factor of three. Thus, stacks remain an important implementation technique for procedure calls, even in the presence of an efficient, compacting garbage collector and large amounts of memory. 2004-10-08T20:34:37Z 2004-10-08T20:34:37Z 1994-03-01 AIM-1462 http://hdl.handle.net/1721.1/6622 en_US AIM-1462 94049 bytes 389294 bytes application/octet-stream application/pdf application/octet-stream application/pdf
spellingShingle Miller, James S.
Rozas, Guillermo J.
Garbage Collection is Fast, But a Stack is Faster
title Garbage Collection is Fast, But a Stack is Faster
title_full Garbage Collection is Fast, But a Stack is Faster
title_fullStr Garbage Collection is Fast, But a Stack is Faster
title_full_unstemmed Garbage Collection is Fast, But a Stack is Faster
title_short Garbage Collection is Fast, But a Stack is Faster
title_sort garbage collection is fast but a stack is faster
url http://hdl.handle.net/1721.1/6622
work_keys_str_mv AT millerjamess garbagecollectionisfastbutastackisfaster
AT rozasguillermoj garbagecollectionisfastbutastackisfaster