Skip to content

[desktop] toImageSync retains display list which can lead to surprising memory retention #138627

@alnitak

Description

@alnitak

Is there an existing issue for this?

Steps to reproduce

  1. run example
  2. wait 40~60 to see memory leak on the OS memory monitor that is not seen in DevTools

Actual results

All the PC memory get filled till system crash

Code sample

I have created a public GitHub project as short as I could.
Some more info in the README.md

Screenshots or Video

After about 40~60 seconds memory leak is starting growing till it reach 100%.
DevTools memory tab doesn't show memory leaks.

Screenshots

Screenshot from 2023-11-17 16-29-57

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.16.0, on Manjaro Linux 6.1.62-1-MANJARO, locale en_US.UTF-8)
    • Flutter version 3.16.0 on channel stable at /home/deimos/dev/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision db7ef5bf9f (2 days ago), 2023-11-15 11:25:44 -0800
    • Engine revision 74d16627b9
    • Dart version 3.2.0
    • DevTools version 2.28.2

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /home/deimos/Android/Sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_HOME = /home/deimos/Android/Sdk
    • ANDROID_SDK_ROOT = /home/deimos/Android/Sdk
    • Java binary at: /home/deimos/dev/android-studio/jbr/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • CHROME_EXECUTABLE = /bin/chromium

[✓] Linux toolchain - develop for Linux desktop
    • clang version 16.0.6
    • cmake version 3.27.7
    • ninja version 1.11.1
    • pkg-config version 1.8.1

[✓] Android Studio (version 2022.2)
    • Android Studio at /home/deimos/dev/android-studio
    • Flutter plugin version 75.1.1
    • Dart plugin version 222.4582
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Manjaro Linux 6.1.62-1-MANJARO
    • Chrome (web)    • chrome • web-javascript • Chromium 119.0.6045.159 Arch Linux

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Assignees

Labels

👍Issue needs retriaging to evaluate its popularityP2Important issues not at the top of the work lista: desktopRunning on desktopc: performanceRelates to speed or footprint issues (see "perf:" labels)customer: crowdAffects or could affect many people, though not necessarily a specific customer.engineflutter/engine related. See also e: labels.found in release: 3.16Found to occur in 3.16found in release: 3.17Found to occur in 3.17has reproducible stepsThe issue has been confirmed reproducible and is ready to work onperf: memoryPerformance issues related to memoryteam-engineOwned by Engine teamtriaged-engineTriaged by Engine team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions