Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C/C++
  3. Mesh

Mesh

Apache-2.0C++

A drop-in malloc replacement that automatically reduces memory fragmentation in C/C++ applications without code changes.

GitHubGitHub
1.9k stars81 forks0 contributors

What is Mesh?

Mesh is a memory allocator that automatically reduces memory fragmentation in C/C++ applications. It serves as a drop-in replacement for malloc that can transparently compact memory without requiring any changes to application code, addressing the long-standing problem of memory fragmentation in long-running programs.

Target Audience

C/C++ developers and system programmers working on applications that suffer from memory fragmentation issues, particularly those running on Linux or macOS systems who want automatic memory optimization without code modifications.

Value Proposition

Developers choose Mesh because it provides automatic memory compaction capabilities unavailable in standard allocators, requires zero code changes through its drop-in replacement approach, and integrates transparently via LD_PRELOAD while maintaining performance through its novel architecture.

Overview

A memory allocator that automatically reduces the memory footprint of C/C++ applications.

Use Cases

Best For

  • Reducing memory footprint in long-running C/C++ server applications
  • Addressing memory fragmentation in applications with complex allocation patterns
  • Optimizing memory usage without modifying existing application code
  • Replacing standard malloc with automatic compaction capabilities
  • Monitoring memory fragmentation recovery through built-in statistics
  • Improving memory efficiency in Linux and macOS C/C++ programs

Not Ideal For

  • Real-time systems requiring predictable allocation latency
  • Windows-only applications due to incomplete support
  • Projects with custom allocators that cannot be swapped out
  • Short-lived programs where memory fragmentation is negligible

Pros & Cons

Pros

Transparent Fragmentation Recovery

Automatically compacts memory to reduce fragmentation without any code changes, as shown in the Redis example where it meshed over 100 MB.

Drop-in Integration

Serves as a direct malloc replacement via LD_PRELOAD or linking, allowing seamless use with existing C/C++ applications like git.

Minimal Runtime Dependencies

Requires only libc at runtime with no additional dependencies, making deployment lightweight and straightforward.

Built-in Performance Monitoring

Provides statistics via the MALLOCSTATS environment variable to track compaction effectiveness, such as meshed MB and allocation counts.

Cons

Incomplete Cross-Platform Support

Windows support is still a work in progress, limiting Mesh to Linux and macOS environments only.

Variable Effectiveness

Not all workloads experience fragmentation, so Mesh may have minimal impact on some applications, as admitted in the README.

Build System Complexity

Relies on Bazel wrapped in a Makefile, which can add setup overhead compared to simpler build systems like CMake or plain Make.

Frequently Asked Questions

Quick Stats

Stars1,870
Forks81
Contributors0
Open Issues29
Last commit4 months ago
CreatedSince 2015

Tags

#systems-programming#malloc-replacement#memory-management#performance-optimization#memory-allocator#memory#c-plus-plus#allocator#linux#macos#fragmentation-reduction

Built With

B
Bazel
l
libc
M
Makefile
C
C++

Included in

C/C++70.6k
Auto-fetched 17 hours ago

Related Projects

mimallocmimalloc

mimalloc is a compact general purpose allocator with excellent performance.

Stars13,215
Forks1,140
Last commit23 hours ago
jemallocjemalloc

General purpose malloc(3) implementation that emphasizes fragmentation avoidance and scalable concurrency support. [BSD] website

Stars11,008
Forks1,636
Last commit1 day ago
TCMallocTCMalloc

TCMalloc is Google's customized implementation of C's `malloc()` and C++'s `operator new` for memory allocation within C and C++ code. It provides a high-performance alternative to standard memory allocators, optimized for multi-threaded applications where allocation speed and scalability are critical. ## Key Features - **Fast Allocation** — Optimized for speed with efficient memory management algorithms - **Multi-threaded Performance** — Designed to scale well in concurrent environments - **Customizable Configuration** — Tunable parameters for different workload requirements - **Comprehensive API** — Full support for C and C++ memory allocation interfaces - **Platform Support** — Available across multiple operating systems and architectures ## Philosophy TCMalloc prioritizes performance and scalability in multi-threaded environments while maintaining compatibility with standard memory allocation interfaces, making it suitable for production systems with demanding memory allocation patterns.

Stars5,292
Forks559
Last commit18 hours ago
Boehm GCBoehm GC

The Boehm-Demers-Weiser conservative C/C++ Garbage Collector (bdwgc, also known as bdw-gc, boehm-gc, libgc)

Stars3,506
Forks441
Last commit1 day ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub