C# class code loaded in RAM ?

Posted by Spi1988 on Stack Overflow See other posts from Stack Overflow or by Spi1988
Published on 2010-01-06T08:08:10Z Indexed on 2010/03/13 13:25 UTC
Read the original article Hit count: 184

Filed under:
|

hi,

I would like to know whether the actual code of a C# class gets loaded in RAM when you instantiate the class?

So for example if I have 2 Classes CLASS A , CLASS B, where class A has 10000 lines of code but just 1 field, an int. And class B has 10 lines of code and also 1 field an int as well. If I instantiate Class A will it take more RAM than Class B due to its lines of code ?

A supplementary question, If the lines of code are loaded in memory together with the class, will they be loaded for every instance of the class? or just once for all the instances?

Thanks in advance.

© Stack Overflow or respective owner

Related posts about c#

Related posts about memory-usage