Repository navigation
Description
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):
DefaultArrayPoolPlatformProvider.cs#L24:ApiInformation.IsPropertyPresent("Windows.System.MemoryManager, Uno", "AppMemoryUsage")FrameworkTemplatePoolDefaultPlatformProvider.cs#L24: same string
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:maxArraysPerBucketfalls from 8192 (DefaultAutomaticMaxNumberOfArraysPerBucket) to 100, and the Gen2 trim callback is never registered (DefaultArrayPool.cs,LinearArrayPool.cs).FrameworkTemplatePoolloses 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.
- 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);
}- Build and run both tests on Skia Desktop (
/runtime-testsflow:dotnet build src/SamplesApp/SamplesApp/SamplesApp.csproj -f net11.0-desktop, thendotnet SamplesApp.dll --runtime-tests=...withUITEST_RUNTIME_TESTS_FILTERset). - Both fail. The
Uno.WinRTand unqualified assertions pass; only the, Unoassertion fails, andCanUseMemoryManagerisfalse. - 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
fix: Re-enable memory-aware pooling (fixes #24871)
khaskoul commentedon Nov 8, 2026