That overhead, BTW, is 8 bytes per object, and is fixed regardless of
the size or number of the methods in the type of the object in question.

Ted Neward
Author, Instructor, Presenter: Java and .NET
http://www.neward.net/ted/weblog
http://www.javageeks.com
http://www.clrgeeks.com

> -----Original Message-----
> From: Moderated discussion of advanced .NET topics. [mailto:ADVANCED-
> [EMAIL PROTECTED] On Behalf Of Ivan Towlson
> Sent: Tuesday, June 17, 2003 1:25 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [ADVANCED-DOTNET] Object Memory Space
>
> Every object carries around a vtable pointer (because System.Object
has
> virtual functions) and a sync block index.  So yes, instantiating even
an
> object with no data will consume memory.
>
> --
> Ivan Towlson
> White Carbon
>
>
> -----Original Message-----
> From: Moderated discussion of advanced .NET topics.
> [mailto:[EMAIL PROTECTED] Behalf Of Craig Boland
> Sent: 16 June 2003 19:44
> To: [EMAIL PROTECTED]
> Subject: [ADVANCED-DOTNET] Object Memory Space
>
>
> Does anyone know what factors affect the memory size an object will
> consume by simply creating a new instance? I know that member-level
value-
> types will consume memory respective of their data type (Int32
consumes 4
> bytes, etc.). What about code? Does a class that contains no member
> variables, but 2000 lines of code consume any memory by simply
> instantiating a new one?

Reply via email to