dart-lang / leak_tracker

A framework for memory leak tracking for Dart and Flutter applications.
https://pub.dev/packages/leak_tracker
BSD 3-Clause "New" or "Revised" License
387 stars 23 forks source link

Provide a way to programmatically save memory heap snapshot in csv or other human readable format #247

Open KimFromMarietta opened 1 week ago

KimFromMarietta commented 1 week ago

I've been able to save heap snapshots from a running Flutter application to CSV within the devtools. I can also save a memory heap snapshot programmatically from my Flutter application with NativeRuntime.writeHeapSnapshotToFile.

How do I convert the saved heap snapshot to csv or other human readable form? I'd like to parse the saved snapshot instead of viewing it in the devtools UI. Thanks

polina-c commented 1 day ago

Run DevTools not connected to the app (for example with VSCode > Flutter Side Panel > Icon "Open DevTools") Open DevTools > Memory Click arrow up button to import the snapshot Save the snapshot as CSV.

Let me know if there are issues.

CC @kenzieschmoll