Turn off full GC (#24545)

Using the full gc sometimes leads to an infinite recursion resulting
in a browser freeze. This was noted as part of running Blazor's benchmarks.
This is being addressed in rc1, in the meanwhile this reverts the behavior to 3.2 defaults.

Browser freezes when using a Blazor WASM application.

Yes. Full GC on is new to WASM on .NET Core

Low. Off by default is the behavior we had in 3.2.
This commit is contained in:
Pranav K 2020-08-03 15:43:34 -07:00 committed by GitHub
parent a78cd6239f
commit fcabe6f0fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -363,6 +363,11 @@ function createEmscriptenModuleInstance(resourceLoader: WebAssemblyResourceLoade
resourceLoader.purgeUnusedCacheEntriesAsync(); // Don't await - it's fine to run in background
MONO.mono_wasm_setenv("MONO_URI_DOTNETRELATIVEORABSOLUTE", "true");
// Turn off full-gc to prevent browser freezing.
const mono_wasm_enable_on_demand_gc = cwrap('mono_wasm_enable_on_demand_gc', null, ['number']);
mono_wasm_enable_on_demand_gc(0);
const load_runtime = cwrap('mono_wasm_load_runtime', null, ['string', 'number']);
// -1 enables debugging with logging disabled. 0 disables debugging entirely.
load_runtime(appBinDirName, hasDebuggingEnabled() ? -1 : 0);