Getting a Handle on Unmanaged Memory
Open Access
- 27 April 2024
- conference paper
- Published by Association for Computing Machinery (ACM)
- p. 448-463
Abstract
The inability to relocate objects in unmanaged languages brings with it a menagerie of problems. Perhaps the most impactful is memory fragmentation, which has long plagued applications such as databases and web servers. These issues either fester or require Herculean programmer effort to address on a per-application basis because, in general, heap objects cannot be moved in unmanaged languages. In contrast, managed languages like C# cleanly address fragmentation through the use of compacting garbage collection techniques built upon heap object movement. In this work, we bridge this gap between unmanaged and managed languages through the use of handles, a level of indirection allowing heap object movement. Handles open the door to seamlessly employing runtime features from managed languages in existing, unmodified code written in unmanaged languages. We describe a new compiler and runtime system, Alaska, that acts as a drop-in replacement for malloc. Without any programmer effort, the Alaska compiler transforms pointer-based code to utilize handles, with optimizations to minimize performance impact. A codesigned runtime system manages this new level of indirection and exploits heap object movement via an extensible service interface. We investigate the overheads of Alaska on large benchmarks and applications spanning multiple domains. To show the power and extensibility of handles, we use Alaska to eliminate fragmentation on the heap through defragmentation, reducing memory usage by up to 40% in Redis.Keywords
All Related Versions
Funding Information
- NSF (National Science Foundation) (CCF-2119069)
This publication has 32 references indexed in Scilit:
- Representing Data Collections in an SSA Form2024
- Tiny Pointers2023
- CHERI: A Hybrid Capability-System Architecture for Scalable Software Compartmentalization2015
- Automatic Restructuring of Linked Data StructuresLecture Notes in Computer Science, 2010
- Automatic pool allocation2005
- Practical and Accurate Low-Level Pointer Analysis2005
- Barriers2004
- LLVM: A compilation framework for lifelong program analysis & transformation2004
- The case for a read barrier1991
- Worst case fragmentation of first fit and best fit storage allocation strategiesThe Computer Journal, 1977