The Boehm-Demers-Weiser conservative garbage collector is a tool that can be used as a replacement for C malloc or C++ new. It allows users to allocate memory without explicitly deallocating it. The collector automatically recycles memory when it determines that it can no longer be accessed. The collector is commonly used by programming language implementations that use C as intermediate code or want to facilitate interoperation with C libraries. It can also be used as a leak detector for C or C++ programs. The collector is available for various platforms and has been used by numerous projects.
https://hboehm.info/gc/