Skip to content

fix: Re-enable memory-aware pooling - #25823

Merged
ramezgerges merged 2 commits into
unoplatform:masterfrom
ramezgerges:dev/rara/memorymanager-probe
Oct 30, 2026
Merged

ramezgerges merged 2 commits into
unoplatform:masterfrom
ramezgerges:dev/rara/memorymanager-probe

Conversation

@ramezgerges

Copy link
Copy Markdown
Contributor

GitHub Issue: closes #24871

PR Type:

🐞 Bugfix

What changed? 🚀

Memory-aware pooling had been silently off since the Uno assembly was renamed to Uno.WinRT.

1. Stale assembly name (ae35aaf5bb)

  • DefaultArrayPoolPlatformProvider and FrameworkTemplatePoolDefaultPlatformProvider checked ApiInformation.IsPropertyPresent("Windows.System.MemoryManager, Uno", ...). That name never resolves now, so both pools ran without memory management.
  • Both now check MemoryManager.IsAvailable directly (true on Skia, WebAssembly and Android; false on iOS, as before).

2. Template pool disabled before the first GC (same commit, not mentioned in the issue)

  • The template pool also required MemoryManager.AppMemoryUsage > 0 once, at type initialization. On Skia that value comes from GC.GetGCMemoryInfo(), which reads 0 until the first garbage collection, so the pool stayed off even with the name fixed.
  • FrameworkTemplatePool.CanUsePool now skips the memory check only while the memory limit has no reading yet.

3. Stale probes in tests and samples (727a27ce37)

  • ", Uno" → ", Uno.WinRT" in Given_MemoryManager, PersonPictureTests, DispatcherQueueExtensions, and the VibrationDevice, IsScreenCaptureEnabled and MessageDialog sample checks. Each type was checked to live in Uno.WinRT.
  • Given_MemoryManager.When_AppMemoryUsage / When_AppMemoryUsageLimit had been reporting Inconclusive because of the old name; they now run.

Behaviour change: pooling now reacts to memory pressure again. On Skia the reading is the machine's overall memory load, so under heavy system memory pressure the template pool stops pooling, as designed.

Validation (Skia Desktop, Win32)

  • New tests Given_MemoryManager.When_Probed_By_Assembly_Name and When_Pools_Check_MemoryManager: the latter fails without the fix (template pool assertion) and passes with it.
  • Given_MemoryManager and PersonPictureTests: all pass.
  • Given_FrameworkTemplatePool, Given_ComboBox, Given_ListViewBase, Given_FrameworkTemplate_And_Leak, Given_MemoryManager: 217 passed, 15 skipped, 1 inconclusive, 0 failed.
  • Not run locally: WebAssembly, Android.

PR Checklist ✅

🤖 Generated with Claude Code

ramezgerges and others added 2 commits October 29, 2026 12:39
The ArrayPool and FrameworkTemplatePool providers probed
"Windows.System.MemoryManager, Uno", which no longer resolves since the
assembly became Uno.WinRT, so both always ran without memory management.
They now check MemoryManager.IsAvailable directly.

The template pool also required AppMemoryUsage > 0 at type init; on Skia
that reads 0 until the first GC, so it stayed off. The pool now skips the
memory check only while the limit has no reading.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@github-actions github-actions Bot added the area/automation Categorizes an issue or PR as relevant to project automation label Oct 29, 2026
@nventive-devops

Copy link
Copy Markdown
Contributor

The build 242267 found UI Test snapshots differences: skia-linux-screenshots: 2458, skia-windows-screenshots: 2458

Details
  • skia-linux-screenshots: 2458 changed over 2492

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AndroidWindowInsets.png
    • AnimatedIconPage.png
    • AppBarToggleButtonTest.png-dark
    • ApplicationViewSizing.png
    • AppWindowFeatures.png-dark
    • AppXamlDefinedResources.png-dark
    • Attributed_text_Simple.png-dark
    • Attributed_text_Supserscript.png-dark
    • AutoBorderStretchwithbottommargin.png
    • AutoBorderStretchwithleftmargin.png-dark
    • AutomationProperties_Relations.png-dark
    • AutomationProperties_Relations.png
    • AutoSuggestBox_Description.png-dark
    • AutoSuggestBox_Description.png
    • AutoSuggestBox_SoftKeboard.png-dark
    • AutoSuggestBox_SoftKeboard.png
    • BasicThemeResources.png-dark
    • BasicThemeResources.png
    • BitmapIcon_Monochromatic.png-dark
    • BitmapIcon_Monochromatic.png
  • skia-windows-screenshots: 2458 changed over 2492

    🚨🚨 Comparison Details (first 20) 🚨🚨
    • AnimatedBackVisualSourceSamplePage.png
    • AppBarButtonWithIconTest.png
    • ApplicationViewSizing.png-dark
    • AppWindowFeatures.png-dark
    • AppWindowTitleBar Properties.png
    • Attributed_text_FontSize_Changing.png-dark
    • AuthenticationBroker_Demo.png
    • AutomationProperties_AutomationId.png
    • AutoSizedPathCentered.png-dark
    • AutoSizedPathCentered.png
    • AutoSuggestBox_Icons.png-dark
    • AutoSuggestBox_Icons.png
    • BasicAcrylicBrushTest2.png-dark
    • BasicAcrylicBrushTest2.png
    • BitmapImage_vs_SvgImageSource.png-dark
    • BitmapImage_vs_SvgImageSource.png
    • BorderLeftwithmargins.png-dark
    • BorderLeftwithmargins.png
    • BorderTopwithmargins.png-dark
    • BorderTopwithmargins.png

@mergify

mergify Bot commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again.

@ramezgerges
ramezgerges merged commit 769af4a into unoplatform:master Oct 30, 2026
47 checks passed
@ramezgerges
ramezgerges deleted the dev/rara/memorymanager-probe branch October 30, 2026 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

4 participants