ivmai/bdwgc
FreeThe Boehm-Demers-Weiser conservative C/C++ Garbage Collector (bdwgc, also known as bdw-gc, boehm-gc, libgc)
About ivmai/bdwgc
The Boehm-Demers-Weiser conservative garbage collector (bdwgc) is a general-purpose, garbage collecting storage allocator for C and C++. Version 8.3.0 (development) is available under an MIT-style license. It is designed to work with uncooperative environments (compilers that do not natively support garbage collection) and is portable across many platforms. The collector uses a conservative approach to identify reachable memory, making it suitable for programs that use raw pointers and C-style memory management. Features include support for multithreaded programs with mostly parallel collection, space-efficient collection, and optimizations to reduce cache misses. The project is mature, well-documented, and actively maintained.
Key Features
Pros & Cons
- Eliminates need for manual memory free() calls, reducing bugs
- Reduces memory leaks and dangling pointer errors
- Portable across many Unix-like systems, Windows, and more
- Mature project with extensive documentation and community support
- Permissive MIT license allows use in both open-source and proprietary projects
- Conservative approach may not collect all garbage (false pointers can retain memory)
- Garbage collection pauses can affect performance in latency-sensitive applications
- Overhead compared to tuned manual memory management in some scenarios
- Not suitable for real-time systems due to unpredictable pause times