leak_tracker
library
Constants
-
isLeakFree
→ const Matcher
-
Checks if the leak collection is empty.
Functions
-
checkLeaks()
→ LeakSummary
-
Checks for leaks and outputs LeakSummary as configured.
-
collectLeaks()
→ Leaks
-
Returns details of the leaks collected since last invocation.
-
disableLeakTracking()
→ void
-
Disables leak tracking for the application.
-
dispatchObjectCreated({required String library, required String className, required Object object, Map<String, dynamic>? context})
→ void
-
Dispatches object creation to the leak tracker.
-
dispatchObjectDisposed({required Object object, Map<String, dynamic>? context})
→ void
-
Dispatches object disposal to the leak tracker.
-
dispatchObjectEvent(Map<Object, Map<String, Object>> event)
→ void
-
Dispatches an object event to the leak tracker.
-
dispatchObjectTrace({required Object object, Map<String, dynamic>? context})
→ void
-
Dispatches additional context information to the leak tracker.
-
enableLeakTracking({LeakTrackingConfiguration? config, bool resetIfAlreadyEnabled = false})
→ void
-
Enables leak tracking for the application.
-
stopMemoryUsageTracking()
→ void
-
Stops memory usage tracking if it is started by trackMemoryUsage.
-
trackMemoryUsage(UsageTrackingConfig config)
→ void
-
Enables memory usage tracking, based on the value of ProcessInfo.currentRss (dart:io).
-
withLeakTracking(DartAsyncCallback callback, {bool shouldThrowOnLeaks = true, Duration? timeoutForFinalGarbageCollection, StackTraceCollectionConfig stackTraceCollectionConfig = const StackTraceCollectionConfig(), AsyncCodeRunner? asyncCodeRunner})
→ Future<Leaks>
-
Runs
callback
with memory leak detection.