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

Introduction

Background

malloc()

glibc malloc() ← ptmalloc()

  • tcmalloc() from Google
  • jemalloc() from Facebook

Programming Language

Key Ideas

Mesh

The key idea: Mesh

Random Allocation

Implementation

  • Mesh = MiniHeaps + Shuffle Vectors + Thread Local Heaps + Global Heap + Meshing
  • MiniHeaps
  • Shuffle Vectors
  • Thread Local Heaps
  • Global Heap
  • Meshing

Related OS APIs in the implementation

  • mmap
  • fallocate (FALLOC_FL_PUNCH_HOLE)
  • mallctl
  • memfd_create
  • mprotect

Evaluation

Conclusion

--

--

--

A system software engineer from Taiwan. The posts are about my daily reading and polishing my English skills.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Vybe Network Partners with Serum and Burnt Finance to Launch NFT Collection

Dictionary In Python

IoTeX Times a Million: Scaling the Internet of Trusted Things

A Guide To Ensure The Best UX For Your WebRTc Application

K largest values by group using Spark UDAF

Getting Git

Top 10 Low-Code Application Builder in the Market

How To Calculate “day of week” Calendar

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
張家榮 Tiba Chang

張家榮 Tiba Chang

A system software engineer from Taiwan. The posts are about my daily reading and polishing my English skills.

More from Medium

Not a Regular Password Regex

In C++, write a method that remove a character from a C string using pointers

Why You May Feel Like You’re Going Crazy “Refactoring” Code?

Idiomatic Event Loop in C++