Skip to content

Commit 82541e4

Browse files
authored
Merge pull request #870 from unoplatform/dev/jela/mem-doc
docs: Update GC docs
2 parents 89254cb + e3e96a8 commit 82541e4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

doc/features-profiling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ A WebAssembly app has multiple categories of allocated memory:
5050
- The managed memory usage, which is the smallest portion of the overall used memory. This is the memory directly done by object allocations from managed code. It is the memory reported by `mprof-report` or the Xamarin Profiler. This memory can be queried by using the [`GC.GetTotalMemory`](https://learn.microsoft.com/en-us/dotnet/api/system.gc.gettotalmemory).
5151
- The WebAssembly module memory usage, which is the overall app memory usage as far as WebAssembly is concerned. This is similar to the committed memory in a Windows app. This contains:
5252
- The runtime's own native memory allocations
53-
- The Garbage Collector memory, which is [directly impacted](xref:Uno.Development.Performance#webassembly-specifics) by the [GC parameters](https://learn.microsoft.com/xamarin/android/internals/garbage-collection#configuration).
53+
- The Garbage Collector memory, which is [directly impacted](xref:Uno.Development.Performance#webassembly-specifics) by the [MONO_GC_PARAMS parameters](https://github.com/dotnet/runtime/blob/0bfb733c6419e78e55286e0d01c5994a337c486a/docs/design/mono/mono-manpage-1.md#environment-variables). Note that the garbage collector over-allocates WebAssembly memory for performance reasons.
5454
- All the files located in the `Package_xxxx/managed` folder. Each assembly file is directly loaded in memory by the .NET runtime, regardless of it being used at the app's startup or not. Reducing the assemblies file sizes can be acheived by configuring the [IL Linker](xref:uno.articles.features.illinker).
5555

5656
The WebAssembly memory can be queried using the following JavaScript expression: `globalThis.Module.HEAPU8.length`, which gives the allocated memory in bytes. You can use [`JSImport`](xref:Uno.Wasm.Bootstrap.JSInterop#invoking-javascript-code-from-c) to read it from managed code.

0 commit comments

Comments
 (0)