Skip to content

Memory: Image cache unbounded growth and large RGBA decode #12566

Open

Description

@kevinchevalier

Summary

Image caching in Warp has two issues: the image cache is never cleared (accumulating resized copies), and agent onboarding decodes large image assets into full RGBA buffers.

Root Causes

  1. ImageCache never cleared — The ImageCache key is (asset_id, size), storing one copy per rendered size. Dragging/resizing a window with an image in the Markdown viewer creates many cached copies. No eviction policy exists.
  2. Agent onboarding RGBA decode — AssetCache::load_asset::<ImageType> and ImageReader::decode materialize a large RGBA buffer in memory when onboarding slides are opened or restored.

Linear Issues

  • APP-3877 — Image cache is not getting cleared
  • APP-4541 — AgentOnboardingView decodes large image asset into RGBA

Activity

  1. added
    warp:prioritized
    on Jun 12, 2026
  2. warp-for-oss commented on Jun 12, 2026

    @warp-for-oss
    Contributor

    @kevinchevalier

    Here's what I found while triaging this issue:

    • The current code supports the reported memory-risk pattern.
    • The image-cache portion overlaps with Image cache is not getting cleared #9789; the onboarding RGBA decode concern appears to be a separate related issue.
    Maintainer details

    I concluded that the issue is a code-supported memory bug combining unbounded rendered image-cache growth with onboarding image assets being decoded and retained as full RGBA buffers..

    Triage summary

    This looks like a valid memory bug with code support for both reported mechanisms.

    • Rendered images are cached by asset plus rendered size/fit, so repeatedly resizing a Markdown viewer image can create many resident resized copies.
    • Agent onboarding preloads bundled slide images through the shared asset cache, and static image formats are decoded into full RGBA buffers.

    Reproducibility

    Reproducibility is medium. The report does not include a standalone repro script, memory profile, Warp version, or platform details, but the referenced paths are present in the current code and make the reported memory behavior plausible.

    Likely root cause

    • The rendered image cache stores entries under an asset hash and RenderedImageCacheKey { bounds, fit_type, animated_image_behavior }. There is whole-asset eviction and a private per-size eviction helper, but the current cache path still inserts rendered size variants without an active bounded/debounced eviction policy.
    • The asset cache stores decoded ImageType assets by AssetSource and type. For static JPEG/PNG/WebP/custom images, decoding converts the compressed bytes into RGBA image buffers, so large onboarding assets can occupy width × height × 4 bytes while retained.
    • Onboarding startup preloads the shared background and slide visual assets when the new settings modes feature flag is enabled, which can materialize those decoded images before or during slide navigation.

    Duplicate check

    Open issue #9789 strongly matches the image-cache portion of this report. I did not find a second likely duplicate or an open/recently closed issue for the onboarding RGBA decode portion, so this issue is not being marked as a duplicate under the repository dedupe threshold.

    This is my automated analysis and may be incorrect. A maintainer will verify the details.

    Powered by Oz

  3. added
    area:editor-notebooks
    area:onboarding
    area:performance
    area:performance:memory
    area:ui-framework
    bug
    repro:medium
    triaged
    on Jun 12, 2026
  4. added
    warp:reserved-internal
    repro:high
    and removed
    repro:medium
    on Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:editor-notebooksarea:onboardingarea:performancearea:performance:memoryarea:ui-frameworkbugrepro:hightriagedwarp:auto-triage-reviewwarp:prioritizedwarp:product-qualitywarp:reserved-internal

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions