Skip to content

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

Description

@Seom88

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.

Activity

  1. richardexfo commented on Feb 26, 2026

    @richardexfo
    Contributor

    We also observed a memory leak on Linux Desktop with Wayland on embedded ARM cpu and an OpenGL ES driver.
    Any animation causes an increase in memory. We are not sure if it's the same issue as the one reported above but is suspiciously similar.

    P.S. Running in software rendering mode (FLUTTER_LINUX_RENDERER=software) solves the memory leak.

  2. Seom88 commented on Feb 27, 2026

    @Seom88
    Author

    Thank you for your comment, but the error reported here does not seem to be related to animations, as it can be replicated with the counter example.
    Other things to add: impeller does not solve it, nor does switching from gtk to libhandy. The only way to solve it is by forcing the use of x11 or xwayland, or, as you mention, by forcing software rendering. This error even affects 3.41.2. The only version where it does not occur is 3.35.7, but it is a bit old. I would like to be able to edit the report to add the indicated tags, but I cannot find the options😅.

  3. added
    platform-linuxBuilding on or for Linux specifically
    engineflutter/engine related. See also e: labels.
    in triagePresently being triaged by the triage team
    team-linuxOwned by the Linux platform team
    c: regressionIt was better in the past than it is now
    on Mar 5, 2026
  4. mbcorona commented on Mar 5, 2026

    @mbcorona
    Member

    Hi @Seom1177 , thanks for reporting.

    Since this is isolated to the Linux Wayland, I am routing this to the Linux team for investigation.

  5. removed
    in triagePresently being triaged by the triage team
    on Mar 6, 2026
  6. added
    P1High-priority issues at the top of the work list
    triaged-linuxTriaged by the Linux platform team
    on Mar 11, 2026
  7. added a commit that references this issue on Mar 13, 2026
  8. added a commit that references this issue on Mar 18, 2026
  9. github-actions commented on Mar 31, 2026

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  10. locked as resolved and limited conversation to collaborators on Mar 31, 2026
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

    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