CppCon 2019: Emery Berger “Mesh: Automatically Compacting Your C++ Application's Memory”
CppCon2 HN recommenders · recommended in 2 months, 2019–2023
talk · advanced · evergreen · 2019–2023 on HN
Emery Berger's CppCon 2019 talk introducing Mesh, a drop-in malloc replacement that compacts memory in unmodified C and C++ programs. It tackles fragmentation by merging pages without changing pointers.
HN recommends Berger's talks as fascinating and cites Mesh as mind-blowing memory allocator work.
Up next
10 mo on HN"Performance Matters" by Emery Berger
Strange Loop Conference
12 HN recommender · 2019–2025
3 mo on HNHow We’re Fooled By Statistics
Veritasium
3 HN recommender · 2014–2025
9 mo on HNModern Dictionaries by Raymond Hettinger
SF Python
9 HN recommender · 2016–2025
11 mo on HNCppCon 2015: Andrei Alexandrescu “std::allocator...”
CppCon
7 HN recommender · 2017–2025
12 mo on HNLexical Scanning in Go - Rob Pike
GoogleFOSSSydney
13 HN recommender · 2012–2025
10 mo on HNCppCon 2017: Matt Kulukundis “Designing a Fast, Efficient, Cache-friendly Hash Table, Step by Step”
CppCon
9 HN recommender · 2018–2026
9 mo on HNRustConf 2018 - Closing Keynote - Using Rust For Game Development by Catherine West
Rust Programming Language
9 HN recommender · 2018–2023
10 mo on HNCppCon 2016: Jason Turner “Rich Code for Tiny Computers: A Simple Commodore 64 Game in C++17”
CppCon
13 HN recommender · 2016–2024
9 mo on HNIdeas about a new programming language for games.
Jonathan Blow
7 HN recommender · 2014–2025
9 mo on HNCppCon 2014: Mike Acton "Data-Oriented Design and C++"
CppCon
9 HN recommender · 2015–2026
9 mo on HNHow I program C
Eskil Steenberg
8 HN recommender · 2017–2025
9 mo on HNGoogle I/O 2012 - Go Concurrency Patterns
Google for Developers
9 HN recommender · 2012–2025
3 comments from Hacker News
You’d need cooperation between your malloc implementation and the application code. It’s possible, but tricky. If your malloc returned a pointer to a pointer, and promised to keep the first level pointer up to date, and was able to lock your application whenever it moved things around, it could work. Someone else already mentioned, but garbage collected languages do actually do this. Because they’re fully in control of memory (the language exposes no raw pointers), they’re able to create the layer of indirection you’ve suggested and move things around as they please. I know at minimum the JVM does this. The term to search for is “heap compaction.” There’s also the weird and wonderful work of Emery Berger et al with their “Mesh” malloc implementation, which blows my mind: ▶ this video .
"Performance matters" by Emery Berger on StrangeLoop'19 is a great talk - link Also, rest of his talks are also fascinating: - ▶ this video - link
According to the cppcon talk about Mesh [1] (an allocator that implement compaction for C++ programs), the overhead can be massive too (17% overhead measured on firefox, 50% on redis!) [1] ▶ this video