In .NET there are 8 bytes of overhead for each object. 4 bytes are a pointer to the object's type. What are the other 4 bytes, known as the object header, used for?
Note: the question was asked in 2010 and is 32 bit specific. The overhead is bitness dependent: 1 pointer-size for the "object's type" (method table) and 1 pointer-size for the object header. So, that's 2*4 bytes for 32 bit and 2*8 bytes for 64 bit applications.
The object header is the topmost area in the object's detail page that provides a detailed glimpse of that object.
Header objects are used to convey information about a remote function call (for example, transaction ID or a method signature).
This article discusses a lot of internals, including what goes into each object instance. Basically, it's the type information and a syncblock pointer (because ever object can potentially be locked upon)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With