Tencent Cloud Middleware
Tencent Cloud Middleware
Jan 3, 2020 · Fundamentals

Why Reference Counting Fails: Understanding GC, Memory Leaks, and Circular References

This article explains the origins of garbage collection, illustrates common memory‑management pitfalls with C‑style malloc/free examples, introduces reference‑counting fundamentals, shows how cyclic references break the algorithm, and compares programmer‑assisted versus runtime solutions while highlighting their trade‑offs.

Automatic Memory ManagementCyclic ReferencesGarbage Collection
0 likes · 16 min read
Why Reference Counting Fails: Understanding GC, Memory Leaks, and Circular References