Repository navigation
NetWasm 0.7.0
Compact is the default garbage collector
NetWasm 0.7.0 selects Compact for wasm32 and wasm64 applications. It is a
size-first, precise, non-moving mark-and-sweep collector with support for the
managed lifetime features in NetWasm's profile: finalizers, resurrection, weak
references, dependent handles and pinning.
Boehm remains available for workloads that benefit from its allocation paths:
<PropertyGroup>
<NetWasmGarbageCollector>Boehm</NetWasmGarbageCollector>
</PropertyGroup>Class libraries remain collector-neutral. Collector selection is a build-time
application choice, not a runtime switch or a global.json setting.
See Choosing a garbage collector
for the tradeoffs and supported controls. The smaller default does not change
NetWasm's documented platform boundaries.
Runtime packs ship prebuilt, optimized native archives for both Debug and Release
C# application builds. GC_DONT_GC requires a diagnostic-enabled Boehm native
runtime; dotnet build -c Debug does not enable that hook.
The qualified Release Console.WriteLine(42) component is 55,825 bytes
with Compact, compared with 84,653 bytes when selecting Boehm. These are
uncompressed complete Wasm components, including the runtime and collector,
not isolated GC sizes or complete browser downloads. See the
measurement methodology.