Learning-based Memory Allocation for C plus plus Server Workloads

被引:27
|
作者
Maas, Martin [1 ]
Andersen, David G. [2 ,4 ]
Isard, Michael [1 ]
Javanmard, Mohammad Mahdi [3 ]
McKinley, Kathryn S. [1 ]
Raffel, Colin [1 ]
机构
[1] Google Res, Mountain View, CA 94043 USA
[2] Carnegie Mellon Univ, Pittsburgh, PA 15213 USA
[3] SUNY Stony Brook, Stony Brook, NY 11794 USA
[4] Google, Mountain View, CA 94043 USA
关键词
Memory management; Machine Learning; Life-time Prediction; Profile-guided Optimization; LSTMs; MODEL;
D O I
10.1145/3373376.3378525
中图分类号
TP3 [计算技术、计算机技术];
学科分类号
0812 ;
摘要
Modern C++ servers have memory footprints that vary widely over time, causing persistent heap fragmentation of up to 2x from long-lived objects allocated during peak memory usage. This fragmentation is exacerbated by the use of huge (2MB) pages, a requirement for high performance on large heap sizes. Reducing fragmentation automatically is challenging because C++ memory managers cannot move objects. This paper presents a new approach to huge page fragmentation. It combines modern machine learning techniques with a novel memory manager (LLAMA) that manages the heap based on object lifetimes and huge pages (divided into blocks and lines). A neural network-based language model predicts lifetime classes using symbolized calling contexts. The model learns context-sensitive per-allocation site lifetimes from previous runs, generalizes over different binary versions, and extrapolates from samples to unobserved calling contexts. Instead of size classes, LLAMA'S heap is organized by lifetime classes that are dynamically adjusted based on observed behavior at a block granularity. LLAMA reduces memory fragmentation by up to 78% while only using huge pages on several production servers. We address ML-specific questions such as tolerating mispredictions and amortizing expensive predictions across application execution. Although our results focus on memory allocation, the questions we identify apply to other system-level problems with strict latency and resource requirements where machine learning could be applied.
引用
收藏
页码:541 / 556
页数:16
相关论文
共 50 条
  • [1] Learning-Based Memory Allocation for C plus plus Server Workloads
    Lea, Doug
    [J]. COMMUNICATIONS OF THE ACM, 2024, 67 (04) : 82 - 82
  • [2] Detection of Memory Leaks in C/C plus plus Code via Machine Learning
    Andrzejak, Artur
    Eichler, Felix
    Ghanavati, Mohammadreza
    [J]. 2017 IEEE 28TH INTERNATIONAL SYMPOSIUM ON SOFTWARE RELIABILITY ENGINEERING WORKSHOPS (ISSREW 2017), 2017, : 252 - 258
  • [3] Heterogeneous Edge Server and Job Allocation Based on k-means plus plus and Transfer Probability
    Ogawa, Kohei
    Miyata, Sumiko
    [J]. 2024 IEEE 21ST CONSUMER COMMUNICATIONS & NETWORKING CONFERENCE, CCNC, 2024, : 612 - 613
  • [4] C plus plus Memory Detection Tool Based on Dynamic Instrumentation
    Fu, Siran
    Cui, Baojiang
    Guo, Tao
    Song, Xuyan
    [J]. ADVANCES IN INTERNET, DATA & WEB TECHNOLOGIES, 2018, 17 : 663 - 674
  • [5] BatNet plus plus : A Robust Deep Learning-based Predicting Models for Calls Recognition
    Hu, Jian
    Huang, Wenzai
    Su, Yongdong
    Liu, Yuting
    Xiao, Peng
    [J]. 2020 5TH INTERNATIONAL CONFERENCE ON SMART GRID AND ELECTRICAL AUTOMATION (ICSGEA 2020), 2020, : 260 - 263
  • [6] Pattern-based Synthesis of Synchronization for the C plus plus Memory Model
    Meshman, Yuri
    Rinetzky, Noam
    Yahav, Eran
    [J]. PROCEEDINGS OF THE 15TH CONFERENCE ON FORMAL METHODS IN COMPUTER-AIDED DESIGN (FMCAD 2015), 2015, : 120 - 127
  • [7] On Monitoring C/C plus plus Transactional Memory Programs
    Fiedor, Jan
    Letko, Zdenek
    Lourenco, Joao
    Vojnar, Tomas
    [J]. MATHEMATICAL AND ENGINEERING METHODS IN COMPUTER SCIENCE, MEMICS 2014, 2014, 8934 : 73 - 87
  • [8] Foundations of the C plus plus Concurrency Memory Model
    Boehm, Hans-J.
    Adve, Sarita V.
    [J]. PLDI'08: PROCEEDINGS OF THE 2008 SIGPLAN CONFERENCE ON PROGRAMMING LANGUAGE DESIGN & IMPLEMENTATION, 2008, : 68 - 78
  • [9] Deep learning-based detection of Plus disease of Retinopathy of Prematurity
    Struyven, Robbert R. R.
    Wagner, Siegfried
    Liefers, Bart
    Zhang, Gongyu
    Glinton, Sophie
    Kelly, Madeline
    Radia, Meera
    Than, Jonathan
    Balal, Shafi
    Hennings, Charles
    Pooprasert, Pakinee
    Pontikos, Nikolas
    Keane, Pearse Andrew
    Patel, Praveen
    Adams, Gillian
    Balaskas, Konstantinos
    [J]. INVESTIGATIVE OPHTHALMOLOGY & VISUAL SCIENCE, 2022, 63 (07)
  • [10] C plus plus Memory Check tool based on Dynamic Binary Instrumentation Platform
    Zhao, Jing Ling
    He, Lei
    He, Bing
    [J]. ADVANCES ON BROAD-BAND WIRELESS COMPUTING, COMMUNICATION AND APPLICATIONS, 2017, 2 : 3 - 11