Skip to content

Memory screen: "Review recent data (offline)" fails in debug builds with "used after being disposed" #10103

Backlog

Description

@khanak0509

Steps to reproduce

  1. Run DevTools from source in debug mode (e.g. flutter run -d chrome in packages/devtools_app).
  2. Connect it to a running app (I used a Dart CLI app) and open the Memory screen.
  3. Stop the app.
  4. On the "Disconnected" overlay, click "Review recent data (offline)".

Expected

The Memory screen shows the data recorded before the disconnect.

Actual

A loading spinner is shown forever. The same steps work on the Performance screen.

issue.mov

Console errors:

Error loading offline data for memory
A ValueNotifier<HeapSample?> was used after being disposed.
  new EventChartController (event_chart_controller.dart:65)
  MemoryChartPaneController.init (chart_pane_controller.dart:39)
  MemoryController._initializeData (memory_controller.dart:130)
Failed assertion: memory_controller.dart:109 '_initialized.isCompleted': is not true.

This only reproduces in debug builds. In release builds (e.g. the DevTools bundled with Dart) the offline view loads, because the "used after being disposed" check is an assert.

Cause

On disconnect, MemoryController.prepareOfflineScreenData passes its live objects (diff, profile, chart.data, trace) instead of serialized data. Then disposeConnectedControllers() disposes the controller, and MemoryChartPaneController.dispose() also disposes chart.data. So the offline Memory controller is created with already-disposed objects. In debug builds, loadData throws and initialized never completes.

Environment

DevTools 2.63.0-dev.0 (master), Dart 3.13.4, Flutter 3.47.5, macOS, Chrome.

Activity

  1. added
    devtools-memory-screen
    type-bug
    contributions welcome
    P2
    on Nov 30, 2026
  2. maheshrijal commented on Dec 3, 2026

    @maheshrijal

    I'd like to work on this. Have a local fix openeing a pr a shortly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2contributions welcomedevexp-uxdevtools-memory-screentype-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions