Skip to content

[Impeller] The Vulkan command pool recycler never releases the pools it caches #194787

Closed

Description

@sero583

CommandPoolRecyclerVK keeps every command pool that comes back to it and never destroys one while the context is alive. The raster thread moves to a fresh pool every frame and after every picture snapshot, and the previous pool comes back once its work has finished on the GPU. So the number of pools never goes down: after a frame with many snapshots, or a few frames with more work in flight, all of those pools stay cached for the lifetime of the context, each with its recycled command buffers and the driver memory behind them.

Capping the list has a trap. Evicting an entry with vector::erase move-assigns RecycledData entries over each other, and move assignment runs in declaration order, so the overwritten entry's pool is destroyed before its command buffers are freed. #189580 capped it that way; with that eviction, a program that grows the cache (128 Picture.toImage calls in flutter_tester against SwiftShader) segfaults at the first eviction, every run. The canvas_test crash under host_release on that PR is not tied to it: locally canvas_test never caches more than 4 pools, so the eviction never runs.

Activity

  1. added
    engine
    perf: memory
    e: impeller
    team-engine
    on Oct 20, 2026
  2. added
    P2
    triaged-engine
    on Oct 26, 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

    P2e: impellerengineperf: memoryteam-enginetriaged-engine

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions