HomeComputer ScienceARC Retain Cycle Lab

ARC Retain Cycle Lab

Interactive 3D reference-counting simulator: allocate heap objects, wire strong and weak references between them, release root variables, and watch iOS-style ARC deallocate objects the instant their retain count hits zero -- or leak them forever in an unreachable retain cycle.

Computer Science3DModerate60 FPS📱 Mobile-adapted⇄ 2D version
mobile-memory-management ↗ Open standalone

A live 3D reference-counting heap in the style of iOS's Automatic Reference Counting. Allocate objects, wire strong or weak references between them, and release the root ("stack variable") holding any object — watch ARC deallocate objects the instant their retain count hits zero, cascading through chains of ownership exactly as a real Objective-C/Swift runtime does. The one-click demos build a classic retain cycle (two objects strongly holding each other, invisible to the reachability scan yet never freed) and then show the same graph fixed by turning one edge into a weak reference, so the leak disappears and both objects deallocate cleanly.

⚙ Under the hood

Interactive 3D reference-counting simulator: allocate heap objects, wire strong and weak references, release root variables, and watch ARC deallocate objects the instant their retain count hits zero -- or leak them forever in an unreachable retain cycle.

memory managementreference countingARCiOSretain cyclecomputer science

3D · Three.js / WebGL renderer · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)