leak_tracker 1.0.0-dev.1.2
leak_tracker: ^1.0.0-dev.1.2 copied to clipboard
A framework for memory leak tracking for Dart and Flutter applications.
Memory Leak Tracker #
This is a framework for memory leak tracking for Dart and Flutter applications.
Coming soon! See https://github.com/flutter/devtools/issues/3951.
The text below this sentence is under construction.
Getting started #
To track memory leaks in your Flutter application:
- Before
runApp
invocation, enable leak tracking, and connect the Flutter memory allocation events:
import 'package:flutter/foundation.dart';
import 'package:leak_tracker/leak_tracker.dart';
...
enableLeakTracking();
MemoryAllocations.instance
.addListener((ObjectEvent event) => dispatchObjectEvent(event.toMap()));
runApp(...
- Run the application in debug mode and watch for a leak related warnings. If you see a warning, open the link to investigate the leaks.
TODO(polina-c): add example of the warning
See more on memory leaks and leak tracking at Dart memory leak tracker.