Skip to content

[Skia][X11] Native window/GL context leaks per ALC-guest window create/close cycle #24076

Open

Description

@kazo0

Current behavior

Each hosted-guest window create/close cycle leaks its native X11 GL context and render threads: roughly 12-15 MB native per cycle, with the llvmpipe thread-group count growing 1:1 with cycles.

Measured across a 16-cycle load/unload soak of three secondary-ALC guest apps. The managed side is fully reclaimed over the same run (15/15 guest ALCs collected, managed heap flat at ~32 MB), so this is native-only.

Reproduces both with and without an explicit Window.Close() before Application.Exit(), so the leak sits in the ALC guest-window native teardown path rather than in anything the host can reach.

Expected behavior

Closing an ALC-guest window releases its native GL context and render threads, and native memory stays flat across repeated guest load/unload cycles.

How to fix

Release the GL context and render-thread resources in the X11 host's ALC-guest-window teardown path.

Host-side workaround: none available. Bounded in practice by the number of guest switches in a session.

Environment

Reproduced against Uno.Sdk.Private 6.7.0-dev.815 (artifacts/uno @ 21bf1ad6), Skia desktop (X11 + Win32) and browserwasm, hosting the three Uno.Themes sample heads as secondary-ALC guests through AlcContentHost / WindowHelper.ContentHostOverride.

Found while building the ThemesSampleApp wrapper head (unoplatform/Uno.Themes#1693); the host-side workarounds all live in GuestAppLoader.Sweeps.cs and are deleted as each fix ships.

Activity

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