Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
10.1145/3617651.3622989acmconferencesArticle/Chapter ViewAbstractPublication PagessplashConference Proceedingsconference-collections
research-article
Open access

Beyond RSS: Towards Intelligent Dynamic Memory Management (Work in Progress)

Published: 19 October 2023 Publication History
  • Get Citation Alerts
  • Abstract

    The main goal of dynamic memory allocators is to minimize memory fragmentation. Fragmentation stems from the interaction between workload behavior and allocator policy. There are, however, no works systematically capturing said interaction. We view this gap as responsible for the absence of a standardized, quantitative fragmentation metric, the lack of workload dynamic memory behavior characterization techniques, and the absence of a standardized benchmark suite targeting dynamic memory allocation. Such shortcomings are profoundly asymmetric to the operation’s ubiquity.
    This paper presents a trace-based simulation methodology for constructing representations of workload-allocator interaction. We use two-dimensional rectangular bin packing (2DBP) as our foundation. 2DBP algorithms minimize their products’ makespan, but virtual memory systems employing demand paging deem such a criterion inappropriate. We see an allocator’s placement decisions as a solution to a 2DBP instance, optimizing some unknown criterion particular to that allocator’s policy. Our end product is a data structure by design concerned with events residing entirely in virtual memory; no information on memory accesses, indexing costs or any other factor is kept.
    We bootstrap our contribution’s utility by exploring its relationship to maximum resident set size (RSS). Our baseline is the assumption that less fragmentation amounts to smaller peak RSS. We thus define a fragmentation metric in the 2DBP substrate and compute it for both single- and multi-threaded workloads linked to 7 modern allocators. We also measure peak RSS for the resulting pairs. Our metric exhibits a monotonic relationship with memory footprint 94% of the time, as inferred via two-tailed statistical hypothesis testing with at least 99% confidence.

    References

    [1]
    [n. d.]. GitHub - google/tcmalloc — github.com. https://github.com/google/tcmalloc [Accessed 29-Jun-2023]
    [2]
    [n. d.]. GitHub - mjansson/rpmalloc: Public domain cross platform lock free thread caching 16-byte aligned memory allocator implemented in C — github.com. https://github.com/mjansson/rpmalloc [Accessed 29-Jun-2023]
    [3]
    [n. d.]. The GNU Allocator (The GNU C Library) — gnu.org. https://www.gnu.org/software/libc/manual/html_node/The-GNU-Allocator.html [Accessed 29-Jun-2023]
    [4]
    Anonymous. 2020. Why does malloc() call mmap() and brk() interchangeably? — stackoverflow.com. https://stackoverflow.com/questions/64029219/why-does-malloc-call-mmap-and-brk-interchangeably [Accessed 29-Jun-2023]
    [5]
    Emery D. Berger, Kathryn S. McKinley, Robert D. Blumofe, and Paul R. Wilson. 2000. Hoard: A Scalable Memory Allocator for Multithreaded Applications. SIGPLAN Not., 35, 11 (2000), nov, 117–128. issn:0362-1340 https://doi.org/10.1145/356989.357000
    [6]
    Emery D. Berger, Benjamin G. Zorn, and Kathryn S. McKinley. 2002. Reconsidering Custom Memory Allocation. SIGPLAN Not., 37, 11 (2002), nov, 1–12. issn:0362-1340 https://doi.org/10.1145/583854.582421
    [7]
    Adam L. Buchsbaum, Howard Karloff, Claire Kenyon, Nick Reingold, and Mikkel Thorup. 2003. OPT versus LOAD in Dynamic Storage Allocation. In Proceedings of the Thirty-Fifth Annual ACM Symposium on Theory of Computing (STOC ’03). Association for Computing Machinery, New York, NY, USA. 556–564. isbn:1581136749 https://doi.org/10.1145/780542.780624
    [8]
    Marek Chrobak and Maciej Ślusarek. 1988. On some packing problem related to dynamic storage allocation. RAIRO-Theoretical Informatics and Applications, 22, 4 (1988), 487–499.
    [9]
    Jason Evans. 2006. A scalable concurrent malloc (3) implementation for FreeBSD. In Proceedings of the BSDCan Conference, Ottawa, Canada.
    [10]
    Michael Garey and David S. Johnson. 1979. Computers and Intractability: A Guide to the Theory of NP-Completeness. W. H. Freeman and Company.
    [11]
    Matthew Hertz, Stephen M Blackburn, J Eliot B Moss, Kathryn S. McKinley, and Darko Stefanović. 2002. Error-Free Garbage Collection Traces: How to Cheat and Not Get Caught. SIGMETRICS Perform. Eval. Rev., 30, 1 (2002), jun, 140–151. issn:0163-5999 https://doi.org/10.1145/511399.511352
    [12]
    Mark S. Johnstone and Paul R. Wilson. 1998. The Memory Fragmentation Problem: Solved? In Proceedings of the 1st International Symposium on Memory Management (ISMM ’98). Association for Computing Machinery, New York, NY, USA. 26–36. isbn:1581131143 https://doi.org/10.1145/286860.286864
    [13]
    H.A. Kierstead. 1991. A polynomial time approximation algorithm for dynamic storage allocation. Discrete Mathematics, 88, 2 (1991), 231–237. issn:0012-365X https://doi.org/10.1016/0012-365X(91)90011-P
    [14]
    Christos Panagiotis Lamprakos, Sotirios Xydis, Francky Catthoor, and Dimitrios Soudris. 2023. The Unexpected Efficiency of Bin Packing Algorithms for Dynamic Storage Allocation in the Wild: An Intellectual Abstract. In Proceedings of the 2023 ACM SIGPLAN International Symposium on Memory Management (ISMM 2023). Association for Computing Machinery, New York, NY, USA. 58–70. isbn:9798400701795 https://doi.org/10.1145/3591195.3595279
    [15]
    Daan Leijen, Benjamin Zorn, and Leonardo de Moura. 2019. Mimalloc: Free List Sharding in Action. In Programming Languages and Systems, Anthony Widjaja Lin (Ed.). Springer International Publishing, Cham. 244–265. isbn:978-3-030-34175-6
    [16]
    Ruihao Li, Qinzhe Wu, Krishna Kavi, Gayatri Mehta, Neeraja J. Yadwadkar, and Lizy K. John. 2023. NextGen-Malloc: Giving Memory Allocator Its Own Room in the House. In Proceedings of the 19th Workshop on Hot Topics in Operating Systems (HOTOS ’23). Association for Computing Machinery, New York, NY, USA. 135–142. isbn:9798400701955 https://doi.org/10.1145/3593856.3595911
    [17]
    Paul Liétar, Theodore Butler, Sylvan Clebsch, Sophia Drossopoulou, Juliana Franco, Matthew J. Parkinson, Alex Shamis, Christoph M. Wintersteiger, and David Chisnall. 2019. Snmalloc: A Message Passing Allocator. In Proceedings of the 2019 ACM SIGPLAN International Symposium on Memory Management (ISMM 2019). Association for Computing Machinery, New York, NY, USA. 122–135. isbn:9781450367226 https://doi.org/10.1145/3315573.3329980
    [18]
    Martin Maas, David G. Andersen, Michael Isard, Mohammad Mahdi Javanmard, Kathryn S. McKinley, and Colin Raffel. 2020. Learning-Based Memory Allocation for C++ Server Workloads. Association for Computing Machinery, New York, NY, USA. 541–556. isbn:9781450371025 https://doi.org/10.1145/3373376.3378525
    [19]
    Martin Maas, Ulysse Beaugnon, Arun Chauhan, and Berkin Ilbeyi. 2022. TelaMalloc: Efficient On-Chip Memory Allocation for Production Machine Learning Accelerators. In Proceedings of the 28th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 1 (ASPLOS 2023). Association for Computing Machinery, New York, NY, USA. 123–137. isbn:9781450399159 https://doi.org/10.1145/3567955.3567961
    [20]
    Martin Maas, Chris Kennelly, Khanh Nguyen, Darryl Gove, Kathryn S. McKinley, and Paul Turner. 2021. Adaptive Huge-Page Subrelease for Non-Moving Memory Allocators in Warehouse-Scale Computers. In Proceedings of the 2021 ACM SIGPLAN International Symposium on Memory Management (ISMM 2021). Association for Computing Machinery, New York, NY, USA. 28–38. isbn:9781450384483 https://doi.org/10.1145/3459898.3463905
    [21]
    Bobby Powers, David Tench, Emery D. Berger, and Andrew McGregor. 2019. Mesh: Compacting Memory Management for C/C++ Applications. In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2019). Association for Computing Machinery, New York, NY, USA. 333–346. isbn:9781450367127 https://doi.org/10.1145/3314221.3314582
    [22]
    John M Robson. 1977. Worst case fragmentation of first fit and best fit storage allocation strategies. Comput. J., 20, 3 (1977), 242–244.
    [23]
    Sidney Siegel. 1957. Nonparametric Statistics. The American Statistician, 11, 3 (1957), 13–19. https://doi.org/10.1080/00031305.1957.10501091
    [24]
    Paul R. Wilson, Mark S. Johnstone, Michael Neely, and David Boles. 1995. Dynamic storage allocation: A survey and critical review. In Memory Management, Henry G. Baler (Ed.). Springer Berlin Heidelberg, Berlin, Heidelberg. 1–116. isbn:978-3-540-45511-0
    [25]
    Jerrold H. Zar. 1972. Significance Testing of the Spearman Rank Correlation Coefficient. J. Amer. Statist. Assoc., 67, 339 (1972), 578–580. https://doi.org/10.1080/01621459.1972.10481251
    [26]
    Kaiyang Zhao, Kaiwen Xue, Ziqi Wang, Dan Schatzberg, Leon Yang, Antonis Manousis, Johannes Weiner, Rik Van Riel, Bikash Sharma, Chunqiang Tang, and Dimitrios Skarlatos. 2023. Contiguitas: The Pursuit of Physical Memory Contiguity in Datacenters. In Proceedings of the 50th Annual International Symposium on Computer Architecture (ISCA ’23). Association for Computing Machinery, New York, NY, USA. Article 44, 15 pages. isbn:9798400700958 https://doi.org/10.1145/3579371.3589079

    Recommendations

    Comments

    Information & Contributors

    Information

    Published In

    cover image ACM Conferences
    MPLR 2023: Proceedings of the 20th ACM SIGPLAN International Conference on Managed Programming Languages and Runtimes
    October 2023
    184 pages
    ISBN:9798400703805
    DOI:10.1145/3617651
    • General Chair:
    • Rodrigo Bruno,
    • Program Chair:
    • Eliot Moss
    This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License.

    Sponsors

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 19 October 2023

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. bin packing
    2. dynamic storage allocation
    3. memory fragmentation

    Qualifiers

    • Research-article

    Conference

    MPLR '23
    Sponsor:

    Upcoming Conference

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • 0
      Total Citations
    • 224
      Total Downloads
    • Downloads (Last 12 months)224
    • Downloads (Last 6 weeks)41
    Reflects downloads up to 11 Aug 2024

    Other Metrics

    Citations

    View Options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Get Access

    Login options

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media