Talk · FlutterCon Europe 2025 · CityCube Berlin, Berlin, Germany · 24 September 2025
This App is Built Different: Advanced Memory Management in Flutter
FlutterCon Europe 2025 talk (Berlin) on how Dart manages memory: heap allocation, garbage collection, leaks, isolates and finding leaks in DevTools.
- Flutter
- Dart
- Memory management
- Garbage collection
- Isolates
- Flutter DevTools
- Performance
Most Flutter apps never think about memory until something goes wrong: the app gets slower over a long session, the OS kills it in the background, or a low-powered device starts dropping frames. This talk, given at FlutterCon Europe 2025 in Berlin, is about understanding what happens under the hood so you can fix those problems on purpose instead of by accident.
What the talk covers
- How Dart allocates memory. Objects, the heap and why short-lived allocations are cheap while long-lived references are what really matter.
- Garbage collection and reachability. An object is only collected when nothing reachable still points to it. Most "leaks" in Flutter are not leaks in the runtime; they are references we forgot to let go of.
- Common leak patterns. Listeners and stream subscriptions that are never cancelled, controllers that are never disposed, closures that capture a
BuildContextor a whole widget, and global caches that only ever grow. - Unnecessary rebuilds. Why rebuilding is usually fine, when it isn't, and how
constwidgets and narrower state help. - Isolates. Moving heavy work such as parsing or image processing off the UI isolate so the interface stays responsive.
- Finding real leaks with Flutter DevTools. Using the memory view, heap snapshots and the diff between snapshots to go from "memory keeps growing" to the exact object that is retained.
The demo
The talk is built around a small demo app that leaks on purpose, so each problem can be reproduced, measured in DevTools and fixed live. The code and slides are on GitHub.
Who it is for
Flutter developers who are comfortable building apps and want to understand performance at the level below widgets, especially on mid-range phones and embedded hardware, where memory is limited and sessions run for a long time.
Key takeaways
- Dispose what you create, cancel what you subscribe to.
- Never hold on to a
BuildContextbeyond the frame you need it in. - Measure before you optimise: DevTools heap snapshots beat guessing.
- Keep the UI isolate for UI; push heavy work to isolates.