HackerPapers

arXiv:1902.04738cs.PL

Mesh: Compacting Memory Management for C/C++ Applications

Bobby Powers, David Tench, Emery D. Berger, Andrew McGregor

Abstract

Programs written in C/C++ can suffer from serious memory fragmentation, leading to low utilization of memory, degraded performance, and application failure due to memory exhaustion. This paper introduces Mesh, a plug-in replacement for malloc that, for the first time, eliminates fragmentation in unmodified C/C++ applications. Mesh combines novel randomized algorithms with widely-supported virtual memory operations to provably reduce fragmentation, breaking the classical Robson bounds with high probability. Mesh generally matches the runtime performance of state-of-the-art memory allocators while reducing memory consumption; in particular, it reduces the memory of consumption of Firefox by 16% and Redis by 39%.

arXiv comments
Draft version, accepted at PLDI 2019
Journal reference
DOI
doi:10.1145/3314221.3314582
Subjects
cs.PLProgramming Languages cs.DSData Structures and Algorithms cs.PFPerformance

On Hacker News

Linked by 5 identifiable commenters in 5 comments across 5 threads, from May 2019 to Jan 2025. Found in 3 HN submissions from Feb 2019 to Nov 2021. Open submission discussions.

Comments linking this paper, per year.

Discussed in comments5 threads

    • There’s a great paper from the group of Emery Berger, where they merge memory pages that become sparse. A kind of garbage collection for C and C++ languages. There’s also a good presentation about it on youtube. https://arxiv.org/abs/1902.04738 The presentation…

      superjanView on HNParent context

    • In the basic generational references approach that was a drawback, and the reason it couldn't release memory back to the OS. We planned to use something like MESH [0] to reduce the fragmentation. We created two newer approaches since then, which let any memory be reused for any…

      verdagonView on HNParent context

    • Actually...https://arxiv.org/pdf/1902.04738.pdf On a more serious note, most c programs I see don't do very much of that, preferring to allocate fixed-size buffers on the stack. Additionally, most GC'd languages that aren't java have crappy GCs, and those GC'd languages that are…

      moonchildView on HNParent context

  1. A new core playlist for VLC 4 1 comment
    • Looks like he reinvented shuffle vectors on his own. I think a lot of people have over the years, but crazy enough nobody bothered to publish it until February this year! Maybe it felt too intuitive? [0] https://observablehq.com/@jobleonard/shuffle-vectors [1]…

      vanderZwanView on HNParent context

    • Fragmentation is solvable. Mesh can compact C programs using malloc/free without any source changes. https://arxiv.org/abs/1902.04738

      sanxiynView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.