'Blazor WebAssembly Garbage Collector innards

As far as I understand, the Blazor WebAssembly runtime is single-threaded.

Can someone describe or point to a reference that explains how the garbage collector execution is interleaved with the rest of the Blazor application?

I would like to understand its concurrency details.

  • Does the garbage collector run on the same thread as the UI?
  • Is it generational?
  • If that is the case, will a full garbage collection stop the world until complete or is it executed in chunks to keep the UI responsive?
  • Is it done on a high level (i.e. using Tasks) or is it performed at a lower level? (perhaps invoked by the IL bytecode interpreter in a cooperative way?)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source