Abstract
In the previous chapter we have gained knowledge about some general GC topics, like when it is triggered and how it decides which generation should be collected. Let's now move into the details of implementation of the first main GC phase - Mark phase.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Notes
- 1.
It does not destroy the MT pointer because MethodTable data address is word-aligned (it is multiplication of 4 or 8 bytes) so at least the two lowest bits are unused (always set to zero). Getting a proper MT pointer from such a modified pointer requires only zeroing the two lowest bits - see GetMethodTable method in CoreCLR for reference.
- 2.
Local variable may represent a primitive type (like numbers), but those are not in our interest here as they do not represent a heap-allocated object.
- 3.
Obviously there will be some fluctuations in the traffic on the page, which makes those numbers not equal to zero.
Author information
Authors and Affiliations
Rights and permissions
Copyright information
© 2018 Konrad Kokosa
About this chapter
Cite this chapter
Kokosa, K. (2018). Garbage Collection - Mark Phase. In: Pro .NET Memory Management. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4027-4_8
Download citation
DOI: https://doi.org/10.1007/978-1-4842-4027-4_8
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-4026-7
Online ISBN: 978-1-4842-4027-4
eBook Packages: Professional and Applied ComputingApress Access BooksProfessional and Applied Computing (R0)