Skip to content

Latest commit

 

History

History
43 lines (26 loc) · 1.6 KB

USAGE.md

File metadata and controls

43 lines (26 loc) · 1.6 KB

Memory usage tracking and auto-snapshotting

This page describes how to configure memory usage tracking. See other information on memory debugging here.

Dart and Flutter applications can be configured to automatically trigger memory usage events and, in case of memory overuse, to save memory heap snapshots to hard drive. The snapshots can be later analyzed in DevTools.

Screen.Recording.2023-04-27.at.11.05.00.AM.mov

Configure usage tracking

Use the function trackMemoryUsage to configure usage events and auto-snapshotting.

See example.

We recommend to have auto-snapshotting off by default, with possibility to enable it via command line arguments in case of reported memory issues.

Analyze snapshots

Use CLI to analyze the collected snapshots.

Upvote the issue to enable graphical snapshot analysis with DevTools.

Auto-snapshotting limitations

By platform

Usage tracking does not work for web platform.

By build mode

While usage tracking events are available for all modes, auto-snapshotting is on or off depending on the build mode:

  • Enabled for: Flutter debug and profile modes (equivalent to Dart debug and release modes).
  • Disabled for: Flutter release mode (equivalent to Dart product mode).

See Dart build modes or Flutter build modes.