Skip to content

Stale ", Uno" assembly name in ApiInformation lookups disables ArrayPool and FrameworkTemplatePool memory management #24871

Closed

Description

@MartinZikmund

Current behavior 🐛

Since the Uno assembly was renamed to Uno.WinRT in 7.0, two in-repo call sites still ask ApiInformation about "Windows.System.MemoryManager, Uno". That lookup now always returns false, even though MemoryManager is implemented on Skia.

Affected code (permalinks at 47267e7):

Because of that, _canUseMemoryManager is permanently false (while MemoryManager.IsAvailable is hard-coded true on Skia/WASM/Android). Result:

  • Uno.Buffers.ArrayPool<T> / LinearArrayPool<T> silently lose automatic memory management: maxArraysPerBucket falls from 8192 (DefaultAutomaticMaxNumberOfArraysPerBucket) to 100, and the Gen2 trim callback is never registered (DefaultArrayPool.cs, LinearArrayPool.cs).
  • FrameworkTemplatePool loses memory-pressure-driven scavenging.
  • The failing Type.GetType("..., Uno") probe also costs startup time (visible in an app-init CPU trace: DefaultArrayPoolPlatformProvider..cctor -> ApiInformation.IsPropertyPresent -> GetValidType -> Type.GetType).

Root cause: ApiInformation.GetValidType first tries Type.GetType(name) (fails, no assembly named Uno), then looks for a registered assembly whose simple name equals Uno. In 7.0 the registered assemblies are Uno.Foundation, Uno.UI, Uno.WinRT and Uno.UI.Composition, so nothing matches.

The same stale ", Uno" suffix is also in SharedHelpers.IsDisplayRegionGetForCurrentViewAvailable (Windows.ApplicationModel.Core.DisplayRegion, Uno), in a few SamplesApp pages, and in runtime tests (Given_MemoryManager.EnsureApiAvailable, PersonPictureTests, DispatcherQueueExtensions). The test ones silently skip (Assert.Inconclusive) or take the wrong branch instead of exercising the API.

Expected behavior 🎯

ApiInformation.IsPropertyPresent("Windows.System.MemoryManager, ...", "AppMemoryUsage") is true on Skia, so the pools enable memory management exactly as they did in 6.x.

How to reproduce it (as minimally and precisely as possible) 🔬

Verified with a runtime test on Skia Desktop (net11.0-desktop) at master 47267e7.

  1. Add to src/Uno.UI.RuntimeTests/Windows/Foundation/Metadata/Given_ApiInformation.cs:
[TestMethod]
public void When_Stale_Uno_Assembly_Name()
{
    Assert.IsTrue(ApiInformation.IsPropertyPresent("Windows.System.MemoryManager, Uno.WinRT", "AppMemoryUsage"), "Uno.WinRT");
    Assert.IsTrue(ApiInformation.IsPropertyPresent("Windows.System.MemoryManager", "AppMemoryUsage"), "unqualified");
    Assert.IsTrue(ApiInformation.IsPropertyPresent("Windows.System.MemoryManager, Uno", "AppMemoryUsage"), "stale ', Uno'");
}

[TestMethod]
public void When_ArrayPool_Provider_Can_Use_MemoryManager()
{
    Assert.IsTrue(Windows.System.MemoryManager.IsAvailable);
    Assert.IsTrue(new Uno.Buffers.DefaultArrayPoolPlatformProvider().CanUseMemoryManager);
}
  1. Build and run both tests on Skia Desktop (/runtime-tests flow: dotnet build src/SamplesApp/SamplesApp/SamplesApp.csproj -f net11.0-desktop, then dotnet SamplesApp.dll --runtime-tests=... with UITEST_RUNTIME_TESTS_FILTER set).
  2. Both fail. The Uno.WinRT and unqualified assertions pass; only the , Uno assertion fails, and CanUseMemoryManager is false.
  3. Apply the fix below: both pass.

Workaround 🛠️

None needed for app code, but the pools run with reduced capacity and no trim callback.

Renderer 🎨

  • Skia
  • Native

(MemoryManager is also available on WASM and Android, so the same probe fails there; the runtime test was run on Skia Desktop only.)

Affected platforms 📱💻🖥️

All platforms 🌍 (the failing probe is in Uno.WinRT/Uno.UI; verified on Desktop).

Uno.Sdk version (and other relevant versions) 📦

Uno 7.0 (master at 47267e7, 7.0.0-dev.*). Worked in 6.x, where the assembly was still named Uno.

IDE version 🧑‍💻

N/A (command line, .NET 11 SDK RC1)

Anything else we need to know? 💬

Suggested fix (tested with the runtime tests above): change the type name to "Windows.System.MemoryManager, Uno.WinRT" (or drop the assembly qualifier) in the two call sites. Better, since the reflection was only a cross-target availability guard, replace the probes with a direct MemoryManager.IsAvailable check. The other stale ", Uno" strings in samples and runtime tests should be updated in the same change, and Given_MemoryManager should then actually run instead of reporting Inconclusive.

Note: Windows.ApplicationModel.Core.DisplayRegion does not exist in Uno at all (only Windows.UI.WindowManagement.DisplayRegion), so the SharedHelpers probe returns false regardless of the assembly name; it is mentioned only for the stale suffix.

Related: the Uno.dll to Uno.WinRT.dll rename itself is an intentional 7.0 breaking change and is not what this issue is about.

Activity

  1. added
    kind/bug
    good first issue
    triage/untriaged
    kind/regression
    project/non-ui ⚙️
    platform/all
    difficulty/starter 🚀
    area/performance 📈
    on Oct 1, 2026
  2. added
    7.0
    on Oct 14, 2026
  3. removed
    triage/untriaged
    7.0
    on Oct 29, 2026
  4. self-assigned this
    on Oct 29, 2026
  5. added a commit that references this issue on Oct 30, 2026
    ae35aaf
  6. khaskoul commented on Nov 8, 2026

    @khaskoul
    Verified fixed on Uno.Sdk 7.0.0-dev.179.
    
    Environment: Windows 11 Pro (26200), .NET SDK 10.0.401, Uno.Sdk / Uno.Templates 7.0.0-dev.179 (Uno.WinUI 7.1.0-dev.90).
    
    I read CanUseMemoryManager on the two providers by reflection in a blank Skia desktop app (Debug):
    
    | Build | Uno.WinUI | FrameworkTemplatePoolDefaultPlatformProvider | DefaultArrayPoolPlatformProvider |
    |---|---|---|---|
    | Uno.Sdk 7.0.0-dev.89 | 7.0.0-dev.2428 | False | False |
    | Uno.Sdk 7.0.0-dev.179 | 7.1.0-dev.90 | True | True |
    
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/performance 📈difficulty/starter 🚀good first issuekind/bugkind/regressionplatform/allproject/non-ui ⚙️

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions