Back to Developer Roadmap

Automatic Reference Counting (ARC)

src/data/roadmaps/swift-ui/content/arc@HBd_J1jUMW-a0Z_Hk9BSL.md

4.01.1 KB
Original Source

Automatic Reference Counting (ARC)

Automatic Reference Counting (ARC) is a memory management feature in Swift that automatically frees up memory used by class instances when they are no longer needed. It works by tracking how many references exist to each object. When the reference count drops to zero, meaning no other parts of the code are using that object, ARC deallocates the memory, preventing memory leaks. This process is automatic, reducing the need for manual memory management like in some other languages.

Visit the following resources to learn more: