
Mobile apps crash when you leak memory, and Dart won't always save you. This walks through the practical stuff: disposing controllers and timers properly, using cacheWidth to stop images from eating all your RAM, and knowing when to reach for isolates instead of choking the main thread. The GC pressure section is solid, especially the reminder that even Dart's generational collector will stutter if you're allocating thousands of objects per frame. If you're debugging why your Flutter app slowly becomes a slideshow or why screens don't release memory after popping, the DevTools tips here will point you in the right direction.
$ npx -y skills add dhruvanbhalara/skills --skill dart-memory --agent claude-codeInstalls into .claude/skills of the current project.
Mobile devices have limited RAM. Efficient memory management is critical to prevent crashes and ensure a smooth user experience.
StreamController, Timer, FocusNode, and ChangeNotifier in the dispose() method.late to delay object creation until it's actually needed, reducing initial memory footprint.build() or high-frequency loops. Reuse data structures where possible.list.clear()) is better than re-assigning it to a new list if the list itself is long-lived.Sponsors