arrow
Return

Combining Machine Learning and Lifetime-Based Resource Management for Memory Allocation and Beyond

delete2024-03-25
delete0
delete
OA
AI
M
Martin Maas *
D
David G. Andersen
M
Michael Isard
M
Mohammad Mahdi Javanmard
K
Kathryn S. McKinley
C
Colin Raffel
DOI:10.1145/3611018delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
Memory management is fundamental to the performance of all applications. On modern server architectures, an application's memory allocator needs to balance memory utilization against the ability to use 2MB huge pages, which are crucial for achieving high performance. This paper shows that prior C++ memory allocators are fundamentally limited because optimizing this trade-off depends on the knowledge of object lifetimes, which is information allocators lack. We introduce a two-step approach to attain high memory utilization in huge pages. We first introduce a novel machine-learning approach that predicts the lifetime of freshly allocated objects using the stack trace at the time of allocation and treats stack traces as natural language. We then present a fundamentally new type of memory allocator that exploits (potentially incorrect) object lifetime predictions to achieve high memory utilization at full huge page usage. In contrast to prior memory allocators that organize their heap around size classes and free lists, our allocator organizes the heap based on predicted lifetime classes and adjusts to mispredictions on the fly. We demonstrate experimentally that this learned lifetime-aware memory allocator (LLAMA) reduces fragmentation with huge pages by up to 78%. Our approach gives rise to a new methodology for applying ML in computer systems. In addition, similar space-time bin packing problems abound in computer science and we discuss how this approach has applications beyond memory allocation to a wide range of problems.

Journal

Communications of the ACM cover
Communications of the ACM
IF:
12.2
Papers:
1.2W
Citations:
3.7W

Organization

C
Carnegie Mellon University
Scholars:
1.4W
Papers: 1.4W
Citations: 2.7W
U
university of north carolina
Scholars:
7.4W
Papers: 6.5W
Citations: 93
G
Google Incorporated
Scholars:
3.5K
Papers: 1.8K
Citations: 8
U
University of North Carolina Chapel Hill
Scholars:
3.9W
Papers: 3.1W
Citations: 46
researcher View more organizations