Skip to main content

Describe the internal layout of a .NET object.

Expert .NET Core
Quick Answer Every .NET object has an object header (8 bytes on 64-bit): a SyncBlock index (for lock and GetHashCode) and a Method Table pointer (links to type info, vtable for virtual dispatch). After the header come the object's fields. This overhead means even a small object costs more memory than its fields alone.

Answer

A .NET object layout includes: Method Table pointer, Sync Block index, aligned fields with padding, and metadata references. The Method Table stores vtable, type hierarchy, and GC tracking 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