Why do we have one GC and one managed heap per process?

As far as I understand in .NET, we have one GC per process and one managed heap per process (it is divided into SOH and LOH).

So, I have a few questions regarding this:

  • If we have several application domains within the process, each domain will share a heap between other domains. It is safe? How is this separation between domains performed?

  • When the GC starts working, it pauses workflows. Thus, if one application domain requires GC to run very often, it will affect other domains that do not require garbage collection at all. And again, is there a division into 0,1,2 generations between domains or all objects for generating 0 from different domains stored in the same generation area 0?

  • Why is the GC and managed heap implemented for each process, and not for the domain?

+4
source share

Source: https://habr.com/ru/post/1445474/


All Articles