P
Peter Hartlén
Hi!
The basic questions here is how an object is stored in memory.
I have an list of a custom object, where the object has a couple of fields,
properties and methods. If we pretend that he fields take 24bytes, the
properties take 12bytes and the methods take 36bytes of code for this
particular object, will the lists memory consumption be (24+12+36)*number of
objects in list ?
I understand that you have to store the field data for each object, as it
probably differs, but how about properties and methods?
Especially method looks the same regardless of what object we are looking at
(I may be mistaking here), so why store the method memory for each object in
a list? Or am I talking STATIC methods here?
Why I am asking is that I am playing around with business layer objects, and
these objects don't have a lot of fields, but the code for the methods might
be quite long. So if the list of these objects is quite long it would
contain a lot of redundant code of the same method code.
Oh well, any comments are welcome
/ Peter
The basic questions here is how an object is stored in memory.
I have an list of a custom object, where the object has a couple of fields,
properties and methods. If we pretend that he fields take 24bytes, the
properties take 12bytes and the methods take 36bytes of code for this
particular object, will the lists memory consumption be (24+12+36)*number of
objects in list ?
I understand that you have to store the field data for each object, as it
probably differs, but how about properties and methods?
Especially method looks the same regardless of what object we are looking at
(I may be mistaking here), so why store the method memory for each object in
a list? Or am I talking STATIC methods here?
Why I am asking is that I am playing around with business layer objects, and
these objects don't have a lot of fields, but the code for the methods might
be quite long. So if the list of these objects is quite long it would
contain a lot of redundant code of the same method code.
Oh well, any comments are welcome
/ Peter