Skip to content

Commit 26bcadf

Browse files
author
devid-bot
committed
fix(devserver): memory-conscious GC profile for the Hot Reload host
The dev-server host is a long-running background daemon on the developer's machine, but inherited the Microsoft.NET.Sdk.Web default (Server GC), which is throughput-oriented and retains committed memory. Under Hot Reload each emit allocates tens of MB of transient garbage; Server GC feels no pressure to collect it, so RSS climbs into multi-GB over a session. Align the host GC profile with a memory-conscious background daemon: - ServerGarbageCollection=false + ConcurrentGarbageCollection=true (Workstation background GC: pressure applied early, transient garbage collected). - runtimeconfig.template.json: System.GC.ConserveMemory=5 (compact heap + decommit to OS), HeapHardLimitPercent=66 (relative last-resort ceiling), HighMemoryPercent=70 (react earlier under machine memory pressure). Fixes #24203
1 parent a37fe6d commit 26bcadf

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

src/Uno.UI.RemoteControl.Host/Uno.UI.RemoteControl.Host.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@
88
<Nullable>enable</Nullable>
99
<NoWarn>$(NoWarn);VSTHRD200</NoWarn>
1010
<DefineConstants>$(DefineConstants);IS_DEVSERVER</DefineConstants>
11+
12+
<!-- The dev-server is a long-running background daemon on the developer's machine.
13+
The default Web SDK profile (Server GC) is throughput-oriented and retains committed
14+
memory; switch to a memory-conscious Workstation profile instead. See #24203. -->
15+
<ServerGarbageCollection>false</ServerGarbageCollection>
16+
<ConcurrentGarbageCollection>true</ConcurrentGarbageCollection>
1117
</PropertyGroup>
1218

1319
<Import Project="../targetframework-override-noplatform.props" />
@@ -99,4 +105,12 @@
99105
<Target Name="GetTargetPath" />
100106
<Target Name="GetCopyToPublishDirectoryItems" />
101107

108+
109+
<ItemGroup>
110+
<!-- runtimeconfig.template.json is a build-time input merged into the generated
111+
Uno.UI.RemoteControl.Host.runtimeconfig.json; it must not be copied to output
112+
nor packed. See #24203. -->
113+
<Content Remove="runtimeconfig.template.json" />
114+
</ItemGroup>
115+
102116
</Project>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"configProperties": {
3+
"System.GC.ConserveMemory": 5,
4+
"System.GC.HeapHardLimitPercent": 66,
5+
"System.GC.HighMemoryPercent": 70
6+
}
7+
}

0 commit comments

Comments
 (0)