Skip to content

Automatically reclaim unused Windows container layers after sandbox sessions #657

Open

Description

@angelofb

After repeatedly launching and closing sandbox sessions, C:\ProgramData\Microsoft\Windows\Containers\Layers keeps growing and consumes [X GB]. I expected temporary layers belonging to terminated sessions to be reclaimed automatically.

Expected: remove unreferenced temporary layers when a session ends, while keeping shared base layers that are still in use. If cleanup is intentionally deferred, please provide a supported cleanup mechanism and document when it runs.

Activity

  1. github-actions commented on Oct 12, 2026

    @github-actions

    Thank you for creating an Issue. Please note that GitHub is not an official channel for Microsoft support requests. To create an official support request, please open a ticket here. Microsoft and the GitHub Community strive to provide a best effort in answering questions and supporting Issues on GitHub.

  2. smiezah-msft commented on Oct 13, 2026

    @smiezah-msft
    Collaborator

    Thanks for reporting this. Could you provide the exact step-by-step repro you are using, starting from how the sandbox/container session is created through how it is terminated? We'd like to reproduce the same lifecycle you're seeing.

    Could you also provide the host environment details, including:

    • Windows host OS/version and build
    • Container/runtime and version being used
    • Sandbox/tooling being used to create the sessions
    • Container image(s) used
    • About how many create/terminate cycles are needed before you observe the growth
    • Disk usage of C:\ProgramData\Microsoft\Windows\Containers\Layers before and after the repro

    From the current description, our understanding is that repeatedly creating and terminating sandbox sessions results in the Layers directory continuing to grow, and the concern is that layers associated with terminated sessions are not being reclaimed. Please let us know if that understanding is incorrect.

    If possible, it would also be helpful to know whether the growth occurs after each session and whether restarting the container runtime or host changes the contents/size of the Layers directory.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions