{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2025,11,13]],"date-time":"2025-11-13T18:38:19Z","timestamp":1763059099464,"version":"3.44.0"},"reference-count":25,"publisher":"Association for Computing Machinery (ACM)","issue":"4","license":[{"start":{"date-parts":[[2024,3,25]],"date-time":"2024-03-25T00:00:00Z","timestamp":1711324800000},"content-version":"vor","delay-in-days":0,"URL":"https:\/\/www.acm.org\/publications\/policies\/copyright_policy#Background"}],"content-domain":{"domain":["dl.acm.org"],"crossmark-restriction":true},"short-container-title":["Commun. ACM"],"published-print":{"date-parts":[[2024,4]]},"abstract":"<jats:p>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.<\/jats:p>\n          <jats:p>\n            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\n            <jats:italic toggle=\"yes\">full huge page usage.<\/jats:italic>\n            In contrast to prior memory allocators that organize their heap around size classes and free lists, our allocator organizes the heap based on predicted\n            <jats:italic toggle=\"yes\">lifetime classes<\/jats:italic>\n            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%.\n          <\/jats:p>\n          <jats:p>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.<\/jats:p>","DOI":"10.1145\/3611018","type":"journal-article","created":{"date-parts":[[2024,3,15]],"date-time":"2024-03-15T08:57:23Z","timestamp":1710493043000},"page":"87-96","update-policy":"https:\/\/doi.org\/10.1145\/crossmark-policy","source":"Crossref","is-referenced-by-count":4,"title":["Combining Machine Learning and Lifetime-Based Resource Management for Memory Allocation and Beyond"],"prefix":"10.1145","volume":"67","author":[{"given":"Martin","family":"Maas","sequence":"first","affiliation":[{"name":"Google Research, Mountain View, CA, USA"}]},{"given":"David G.","family":"Andersen","sequence":"additional","affiliation":[{"name":"Carnegie Mellon University, Pittsburgh, PA, USA"}]},{"given":"Michael","family":"Isard","sequence":"additional","affiliation":[{"name":"Google Research, San Francisco, CA, USA"}]},{"given":"Mohammad Mahdi","family":"Javanmard","sequence":"additional","affiliation":[{"name":"Meta, New York, NY, USA"}]},{"given":"Kathryn S.","family":"McKinley","sequence":"additional","affiliation":[{"name":"Google, Seattle, WA, USA"}]},{"given":"Colin","family":"Raffel","sequence":"additional","affiliation":[{"name":"University of North Carolina, Chapel Hill, NC, USA"}]}],"member":"320","published-online":{"date-parts":[[2024,3,25]]},"reference":[{"key":"e_1_2_1_1_1","volume-title":"Proceedings of the 12th USENIX Conference on Operating Systems Design and Implementation OSDI'16","author":"Abadi M.","year":"2016","unstructured":"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."},{"key":"e_1_2_1_2_1","volume-title":"A survey of machine learning for big code and naturalness. ACM Comput. Surv. (CSUR) 51, 4","author":"Allamanis M.","year":"2018","unstructured":"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."},{"key":"e_1_2_1_3_1","volume-title":"6th International Conference on Learning Representations, ICLR 2018, Vancouver, BC, Canada, April 30--May 3, 2018, Conference Track Proceedings","author":"Allamanis M.","year":"2018","unstructured":"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."},{"key":"e_1_2_1_4_1","doi-asserted-by":"publisher","DOI":"10.1145\/155090.155108"},{"key":"e_1_2_1_5_1","doi-asserted-by":"publisher","DOI":"10.1145\/2485922.2485943"},{"key":"e_1_2_1_6_1","doi-asserted-by":"publisher","DOI":"10.1145\/1375581.1375586"},{"key":"e_1_2_1_7_1","doi-asserted-by":"publisher","DOI":"10.1145\/3302424.3303988"},{"key":"e_1_2_1_8_1","volume-title":"Learning to Improve Code Efficiency","author":"Chen B.","year":"2022","unstructured":"Chen, B., Tarlow, D., Swersky, K., Maas, M., Heiber, P., Naik, A., et al. Learning to Improve Code Efficiency (2022). https:\/\/arxiv.org\/abs\/2208.05297."},{"key":"e_1_2_1_9_1","doi-asserted-by":"publisher","DOI":"10.1145\/2754169.2754181"},{"key":"e_1_2_1_10_1","doi-asserted-by":"publisher","DOI":"10.1007\/s10710-017-9314-z"},{"key":"e_1_2_1_11_1","volume-title":"pprof","author":"Google","year":"2020","unstructured":"Google. pprof. 2020. https:\/\/github.com\/google\/pprof."},{"key":"e_1_2_1_12_1","doi-asserted-by":"publisher","DOI":"10.1162\/neco.1997.9.8.1735"},{"key":"e_1_2_1_13_1","volume-title":"15th USENIX Symposium on Operating Systems Design and Implementation (OSDI 21)","author":"Hunter A.","year":"2021","unstructured":"Hunter, A., Kennelly, C., Turner, P., Gove, D., Moseley, T., Ranganathan, P. Beyond malloc efficiency to fleet efficiency: A hugepage-aware memory allocator. In 15th USENIX Symposium on Operating Systems Design and Implementation (OSDI 21) (2021), USENIX Association, Berkeley, CA, 257--273."},{"key":"e_1_2_1_14_1","doi-asserted-by":"publisher","DOI":"10.1145\/2749469.2750392"},{"key":"e_1_2_1_15_1","doi-asserted-by":"publisher","DOI":"10.1162\/neco.1989.1.4.541"},{"key":"e_1_2_1_16_1","doi-asserted-by":"publisher","DOI":"10.1109\/ISCA.2014.6853237"},{"key":"e_1_2_1_17_1","doi-asserted-by":"publisher","DOI":"10.1109\/MM.2020.3012883"},{"key":"e_1_2_1_18_1","doi-asserted-by":"publisher","DOI":"10.1145\/3459898.3463905"},{"volume-title":"1st International Conference on Learning Representations (ICLR 2013) (Scottsdale, Arizona, USA, May 2--4, 2013), Workshop Track Proceedings.","author":"Mikolov T.","key":"e_1_2_1_19_1","unstructured":"Mikolov, T., Chen, K., Corrado, G., Dean, J. Efficient estimation of word representations in vector space. In 1st International Conference on Learning Representations (ICLR 2013) (Scottsdale, Arizona, USA, May 2--4, 2013), Workshop Track Proceedings."},{"key":"e_1_2_1_20_1","doi-asserted-by":"publisher","DOI":"10.1145\/1640089.1640102"},{"key":"e_1_2_1_21_1","volume-title":"Workshop on ML Systems at NIPS 2017;","author":"Olston C.","year":"2017","unstructured":"Olston, C., Li, F., Harmsen, J., Soyke J., Gorovoy, K., Lao, L. et al. TensorFlow-Serving: Flexible, high-performance ML serving. In Workshop on ML Systems at NIPS 2017; 2017."},{"key":"e_1_2_1_22_1","doi-asserted-by":"publisher","DOI":"10.1145\/3314221.3314582"},{"key":"e_1_2_1_23_1","doi-asserted-by":"publisher","DOI":"10.1109\/CVPR.2016.308"},{"key":"e_1_2_1_24_1","volume-title":"Dynamic storage allocation: A survey and critical review","author":"Wilson P.R.","year":"1995","unstructured":"Wilson, P.R., Johnstone, M.S., Neely, M., Boles, D. Dynamic storage allocation: A survey and critical review. In Memory Management. H.G. Baler, ed. Berlin, Heidelberg, Springer Berlin Heidelberg, 1995, 1--116."},{"key":"e_1_2_1_25_1","volume-title":"Proceedings of Machine Learning and Systems. A. Smola, A. Dimakis and I. Stoica, eds","volume":"3","author":"Zhou G.","year":"2021","unstructured":"Zhou, G., Maas, M. Learning on distributed traces for data center storage systems. In Proceedings of Machine Learning and Systems. A. Smola, A. Dimakis and I. Stoica, eds, Volume 3, 2021, 350--364."}],"container-title":["Communications of the ACM"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3611018","content-type":"unspecified","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/dl.acm.org\/doi\/pdf\/10.1145\/3611018","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2025,8,23]],"date-time":"2025-08-23T18:31:00Z","timestamp":1755973860000},"score":1,"resource":{"primary":{"URL":"https:\/\/dl.acm.org\/doi\/10.1145\/3611018"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2024,3,25]]},"references-count":25,"journal-issue":{"issue":"4","published-print":{"date-parts":[[2024,4]]}},"alternative-id":["10.1145\/3611018"],"URL":"https:\/\/doi.org\/10.1145\/3611018","relation":{},"ISSN":["0001-0782","1557-7317"],"issn-type":[{"type":"print","value":"0001-0782"},{"type":"electronic","value":"1557-7317"}],"subject":[],"published":{"date-parts":[[2024,3,25]]},"assertion":[{"value":"2024-03-25","order":3,"name":"published","label":"Published","group":{"name":"publication_history","label":"Publication History"}}]}}