Reference Counting

Noun · Development

Definitions

  1. A memory management technique where each object tracks the number of references pointing to it. When the count drops to zero, the object is immediately deallocated. Used by Python (with cycle detection), Swift (ARC), and Rust (Rc/Arc). Simple and deterministic, but cannot handle circular references without help.

    In plain English: A way of managing memory by counting how many parts of the program are using a piece of data. When nobody is using it anymore, it gets cleaned up immediately.

    Example: "Swift uses ARC — every time you assign an object, the reference count goes up. When it hits zero, the memory is freed instantly."

Related Terms