Skip to main content

Garbage Collection - Mark Phase

  • Chapter
  • First Online:
Pro .NET Memory Management
  • 2528 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 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. 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. 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

Authors

Rights and permissions

Reprints and permissions

Copyright information

© 2018 Konrad Kokosa

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

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

Publish with us

Policies and ethics