HomeComputer ScienceARC Retain Cycle Lab 2D

ARC Retain Cycle Lab 2D

Interactive 2D reference-counting simulator: allocate heap objects on a graph canvas, 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. Drag to pan, scroll to zoom, tune layout and animation with live sliders.

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

A live 2D reference-counting heap in the style of iOS's Automatic Reference Counting, rendered as a pannable, zoomable node graph instead of a 3D scene. 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), show the same graph fixed by turning one edge into a weak reference, or stress-test the heap with random allocation/wiring churn. Sliders tune layout spacing, animation speed and node size live; toggles switch retain-count labels, leak-pulse highlighting and the background grid; a scrolling event log and a live node table track every allocation, wiring change and deallocation as it happens.

⚙ Under the hood

Interactive 2D reference-counting simulator: allocate heap objects on a pannable, zoomable graph canvas, 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.

memory managementreference countingARCiOSretain cyclecomputer science

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)