leak_tracker
library
Functions
-
checkLeaks()
→ Future<LeakSummary>
-
Checks for leaks and outputs LeakSummary as configured.
-
checkNonGCed()
→ Future<void>
-
Checks for new not GCed leaks.
-
collectLeaks()
→ Future<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.
-
forceGC({Duration? timeout, int fullGcCycles = 1})
→ Future<void>
-
Forces garbage collection by aggressive memory allocation.
-
formattedRetainingPath(WeakReference<Object> ref)
→ Future<String?>
-
Returns nicely formatted retaining path for the
ref.target
.
-
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, LeakDiagnosticConfig leakDiagnosticConfig = const LeakDiagnosticConfig(), AsyncCodeRunner? asyncCodeRunner})
→ Future<Leaks>
-
Runs
callback
with memory leak detection.