Skip to content

Resource leak when rotating the screen on Android with Impeller/Vulkan #190114

Closed

Description

@jason-simmons

On some platforms Impeller/Vulkan is leaking resources each time the screen is rotated.

Reproduced this on a Pixel 6a.

  • Run the default template app
  • In adb shell, run this to get a count of file descriptors opened by the app process:
APP=[app package name]
run-as $APP ls /proc/`pidof $APP`/fd | wc
  • Rotate the screen repeatedly. The count of file descriptors will increase each time the app window is resized.

On the Pixel 6a, each rotation adds a pair of dmabuf file descriptors:

160 -> /dmabuf:system
161 -> /dmabuf:f2bb30a SurfaceView[com.example

Debugged this and found that the leak is coming from KHRSwapchainVK.

When the window changes its size, KHRSwapchainVK::AcquireNextDrawable was calling vkAcquireNextImageKHR but never presenting the acquired image.

KHRSwapchainVK::AcquireNextDrawable would then call vkDestroySwapchainKHR on the swapchain associated with the old size. But vkDestroySwapchainKHR requires completion of all operations on images acquired from the swapchain before destroying the swapchain. The extra image that was acquired but not presented apparently resulted in leaks.

Activity

  1. added
    platform-androidAndroid applications specifically
    engineflutter/engine related. See also e: labels.
    e: impellerImpeller rendering backend issues and features requests
    on Jul 28, 2026
  2. github-actions commented on Aug 14, 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.

  3. locked as resolved and limited conversation to collaborators on Aug 14, 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

    e: impellerImpeller rendering backend issues and features requestsengineflutter/engine related. See also e: labels.platform-androidAndroid applications specificallyteam-engineOwned by Engine team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions