dart-lang / native

Dart packages related to FFI and native assets bundling.
BSD 3-Clause "New" or "Revised" License
157 stars 44 forks source link

DevTools extension for package:jni #1034

Open HosseinYousefi opened 8 months ago

HosseinYousefi commented 8 months ago

This could be used for keeping track of the references, identifying leaks, etc.

See: https://medium.com/flutter/dart-flutter-devtools-extensions-c8bc1aaf8e5f

dcharkes commented 8 months ago

Did you mean the use of https://pub.dev/packages/leak_tracker in there?

I remember having a discussion with @polina-c before about the difference between Finalizable and Disposable (https://pub.dev/documentation/w_common/latest/disposable/Disposable-class.html) before. E.g. Disposables must have their dispose called by the programmer or it's a leak. Finalizables can have their release/free called eagerly. (I think the tricky part with finalizable's is probably not the GC or eager release, but cyclic reference between Java and Dart.)

Possibly we could hook stuff up to the leak tracker. 👍