LeakTrackerException class final
Exception thrown when one or more memory leaks are detected.
A LeakTrackerException aggregates all outstanding Allocation records that were considered leaks according to a LeakFilter. It is designed to provide a structured, human-readable diagnostic report suitable for logs, test failures, or debugging output.
This exception is typically thrown at validation boundaries (for example, after a test or scoped execution block) to signal that allocated memory was not properly released.
- Implemented types
Constructors
-
LeakTrackerException({required List<
Allocation> leaks, LeakFilter filter = const .ignoreNone()}) - Creates a leak report exception.
Properties
- count → int
-
Total number of leaked allocations.
no setter
- filter → LeakFilter
-
The filter that determined which allocations count as leaks.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
leaks
→ List<
Allocation> -
All allocations that were still outstanding when detection occurred.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- totalBytes → int
-
Sum of the sizes of all leaked allocations, in bytes.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited