问题
Is there single GC Heap process wide partitioned in such a way that each Application Domain has access to specific partition ? Or each Application Domain has separate GC Heap? I am sure about the other heaps such as HF Heap, LF Heap, Stub Heap, Handle Table and few more..., all these heaps are allocated separately for each application domain? Does the GC Heap also gets allocated separately?
This may probably be true as objects cannot be passed between AppDomains unless object is serializable or implemented as MarshalByRef. I was thinking if there is something called AppDomainID associated with each object and Object Header (Sync Block) stores the information regarding the AppDomainID?
回答1:
You have heap for an process, and the app domains share this heap.
An Application Domain stay light-weight process that functions as unit of isolation in process.
来源:https://stackoverflow.com/questions/12219815/appdomains-and-gc-heap