Overview of native memory leak tracking with ffi_leak_tracker
The package:ffi_leak_tracker allows developers to identify native memory leaks in Dart FFI code by tracking allocations made through its specific allocators. It records the address, size, type, call stack, and timestamp of each allocation.
Key constraints:
- Tracking is opt-in and disabled by default.
- Only allocations made via
ffi_leak_trackerallocators are tracked; direct calls tocalloc()ormalloc()are not visible to the tracker. - Adaptive allocators have zero overhead in release builds as they compile away to standard
calloc()/malloc().