Hi
Can any one help me when i declare the object type variable how much space or memory will occupy it.....?
and what is difference b/w Object and object in .net
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
VulpesPosted Jun 25, 2011, 6:46 AM
Dorababu MekaPosted Jun 25, 2011, 3:15 AM
The only things which are likely to end up on the large object heap are arrays and strings - other objects tends to be relatively small in themselves. Even an object with (say) 10 reference type variables (4 bytes each on x86) and 10 GUIDs (16 bytes each) is only going to take up about 208 bytes (there's a bit of overhead for the type reference and sync block).
Likewise when thinking about the size of an array, don't forget that if the element type is a reference type, then it's only the size of the references that count for the array itself. In other words, even if you've got an array with 20,000 elements, the size of the array object itself will only be just over 80K (on x86) even if it references a lot more data
No difference
C# provides synonyms for the primitives defined by the CLR.
System.String -> string,
System.Int64 -> long,
System.Object -> object, like wise