Skip to main content

What is the internal layout of a .NET object?

Expert C#
Quick Answer Every .NET object on the heap has a header containing a Method Table pointer (links to the type's vtable and metadata) and a Sync Block index (used for lock and GetHashCode). After the header come the object's fields, aligned for the platform. Understanding this explains why small objects still have memory overhead.

Answer

A .NET object contains:

  • Object Header: Method Table pointer + Sync Block index.
  • Aligned fields with padding.
  • Method Table with hierarchy, vtable, and GC info.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice