0Pricing
Swift Academy · Lesson

Allocations and Leaks Instruments

Tracking heap allocations, finding memory leaks and zombie objects.

Allocations Instrument

The Allocations instrument tracks every heap allocation and deallocation, showing memory growth over time.

// Instruments → Allocations template
// Shows live bytes, allocation count, and transient objects

Heap Growth Analysis

Exercise your app and watch the Live Bytes graph. Steady growth without plateauing indicates a memory leak.

// Normal: allocations rise and fall as views appear/disappear
// Leak: allocations only grow, never released

All lessons in this course

  1. Instruments Basics: Time Profiler
  2. Allocations and Leaks Instruments
  3. Main Thread Checker and Hangs
  4. Optimising Hot Paths: COW, Inlining and Specialisation
← Back to Swift Academy