# bdwgc/bdwgc

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

Repository: https://github.com/bdwgc/bdwgc
Canonical: https://ross.abutalabs.com/products/bdwgc
Homepage: https://www.hboehm.info/gc/
Language: C
License: NOASSERTION
License Family: other
Topics: garbage-collection, memory-management, memory-leak-detection, c, cpp, c-plus-plus, cplusplus, gc, garbage-collector, memory-allocation, portable, cross-platform, library, leak-detection
Last push: 2026-08-23T05:27:29+00:00

## Health v2 (maintenance only)
Score: 89/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 69, longevity 100
- inputs: {"age_days": 5517, "days_push": 10, "days_rel": 209, "gap_med": 0.0, "n_releases_24m": 15}
- flags: no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3529, forks 443 (observed 2026-08-28T04:08:08.876542+00:00)

## What it is
The Boehm-Demers-Weiser conservative garbage collector (libgc) for C and C++, usable as a drop-in replacement for malloc/new that automatically reclaims unreachable memory. It can also serve as a memory leak detector and is used by many language runtime implementations.

## Use cases
- add garbage collection to a C or C++ program without manual free calls
- replace malloc with GC_malloc to avoid memory leaks
- detect memory leaks in existing C/C++ code
- provide a GC runtime for a programming language implemented on top of C
- allocate memory without explicit deallocation in long-running applications

## When to choose
- you want automatic memory management in C or C++ with minimal code changes
- you are building a language runtime that needs a battle-tested conservative GC
- you need a portable, cross-platform GC library with broad platform support
- you want to use the collector as a leak detector for legacy code

## When to avoid
- you need precise, deterministic memory reclamation or real-time guarantees
- your codebase relies on hidden or obfuscated pointers that a conservative collector may miss
- you need strict bounding of memory usage in the presence of stale pointers
- you prefer modern smart pointers or RAII over garbage collection

## Facets
- artifact type: library
- maturity: stable
- function: developer-tools
- domain: developer-tools, programming-languages, performance
- platform: cross-platform, windows, cpp, c
- tags: garbage-collection, memory-management, memory-allocation, leak-detection, conservative-gc, c, cpp, linux, macos

## Member repositories
- bdwgc/bdwgc (main) score 89

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:08.876542+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:35:07.704777+00:00, confidence not recorded.
  - readme: https://github.com/bdwgc/bdwgc (fetched 2026-08-28T04:08:08.876542+00:00, sha 96793953d655)
  - homepage: https://www.hboehm.info/gc/ (fetched 2026-08-29T09:29:07.459715+00:00, sha 0cf632d9585c)
  - site_page: https://www.hboehm.info/gc/faq.html (fetched 2026-08-29T09:29:07.482872+00:00, sha d009cef8b4c3)
- Data as of 2026-08-30T08:39:29.467469+00:00.
