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

Author:

Maas Martin1,Andersen David G.2,Isard Michael3,Javanmard Mohammad Mahdi4,McKinley Kathryn S.5,Raffel Colin6

Affiliation:

1. Google Research, Mountain View, CA, USA

2. Carnegie Mellon University, Pittsburgh, PA, USA

3. Google Research, San Francisco, CA, USA

4. Meta, New York, NY, USA

5. Google, Seattle, WA, USA

6. University of North Carolina, Chapel Hill, NC, USA

Abstract

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.

Publisher

Association for Computing Machinery (ACM)

Reference25 articles.

1. Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., et al. Tensorflow: A system for large-scale machine learning. In Proceedings of the 12th USENIX Conference on Operating Systems Design and Implementation OSDI'16 (2016), USENIX Association, Berkeley, CA, 265--283.

2. Allamanis, M., Barr, E.T., Devanbu, P., Sutton, C. A survey of machine learning for big code and naturalness. ACM Comput. Surv. (CSUR) 51, 4 (2018), 81.

3. Allamanis, M., Brockschmidt, M., Khademi, M. Learning to represent programs with graphs. In 6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30--May 3, 2018, Conference Track Proceedings (2018), OpenReview.net.

4. Using lifetime predictors to improve memory allocation performance

5. Efficient virtual memory for big memory servers

同舟云学术

1.学者识别学者识别

2.学术分析学术分析

3.人才评估人才评估

"同舟云学术"是以全球学者为主线,采集、加工和组织学术论文而形成的新型学术文献查询和分析系统,可以对全球学者进行文献检索和人才价值评估。用户可以通过关注某些学科领域的顶尖人物而持续追踪该领域的学科进展和研究前沿。经过近期的数据扩容,当前同舟云学术共收录了国内外主流学术期刊6万余种,收集的期刊论文及会议论文总量共计约1.5亿篇,并以每天添加12000余篇中外论文的速度递增。我们也可以为用户提供个性化、定制化的学者数据。欢迎来电咨询!咨询电话:010-8811{复制后删除}0370

www.globalauthorid.com

TOP

Copyright © 2019-2024 北京同舟云网络信息技术有限公司
京公网安备11010802033243号  京ICP备18003416号-3