Skip to content

[Linux] High VRAM usage when resizing desktop app on Wayland #182192

@Seom1177

Description

@Seom1177

Steps to reproduce

Create a new project, use Flutter 3.38 or later (also available in master), you need to launch the application with Wayland, change the window size multiple times (you can see this with resources, mission, or KDE monitor by enabling the video memory option), this only happens if the app is launched with Wayland, xon xwayland/x11 works fine.

On Gnome
https://github.com/user-attachments/assets/a81969e3-990a-4e3f-a5e8-06b98840ad26

On KDE wayland with x11 workarround
https://github.com/user-attachments/assets/8f112518-5d0e-4c8c-aeeb-3ab481df74b0

I am currently using 3.35.7 as it is the latest stable version without the memory leak.

Code sample

Use default flutter counter app or any project with latest flutter like snap-store on Ubuntu 25.04 (snap-store works fine on 24.04, but if you update to edge channel the error appears).

What target platforms are you seeing this bug on?

Linux

OS/Browser name and version | Device information

I tested on
OS: Fedora 43, Almalinux 10.1, CachyOS, Ubuntu 24.04/20.10
DE: Gnome/KDE Wayland
CPU: AMD Ryzen™ 7 7735HS / Intel i5 12450H
GPU: AMD Radeon™ 680M / intel graphics / Nvidia gtx 1650
RAM: 32 GB

Does the problem occur on emulator/simulator as well as on physical devices?

Unknown

Logs

Logs
build/linux/x64/release/bundle/rufcc

(com.example.rufcc:48808): Atk-CRITICAL **: 18:02:36.402: atk_socket_embed: assertion 'plug_id != NULL' failed
Gdk-Message: 18:02:36.526: Unable to load from the cursor theme
embedder.cc (2575): 'FlutterEngineRemoveView' returned 'kInvalidArguments'. Remove view info was invalid. The implicit view cannot be removed.

** (com.example.rufcc:48808): WARNING **: 18:02:41.810: Failed to cleanup compositor shaders, unable to make OpenGL context current

Flutter Doctor output

Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, 3.41.0-1.0.pre-513, on Fedora Linux 43 (Workstation Edition)
    6.18.8-200.fc43.x86_64, locale en_US.UTF-8)
[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/to/linux-android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✗] Chrome - develop for the web (Cannot find Chrome executable at google-chrome)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[✓] Linux toolchain - develop for Linux desktop
[✓] Connected device (1 available)
[✓] Network resources

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listc: regressionIt was better in the past than it is nowengineflutter/engine related. See also e: labels.found in release: 3.35Found to occur in 3.35found in release: 3.41Found to occur in 3.41from: performance templateIssues created via a performance issue templateplatform-linuxBuilding on or for Linux specificallyteam-linuxOwned by the Linux platform teamtriaged-linuxTriaged by the Linux platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions