eschneider
6/27/2008 7:50:00 PM
Ok, but you point is they do count for something (4 or 8 bytes for each
reference).
So if you have a lot of references it could end-up over the limit.
Thanks,
Schneider
"Jeroen Mostert" <jmostert@xs4all.nl> wrote in message
news:48654009$0$14359$e4fe514c@news.xs4all.nl...
> eschneider wrote:
>> When determining the size of the object for the LOH, I assume that sub
>> objects (like Address in the Person class) are excluded?
>>
> They're not, but of course reference types only count as 4 bytes (or 8
> bytes if you're 64-bit). The LOH size determination doesn't recursively
> walk the object structure to add up sizes, if that's what you mean.
> Indeed, since those sub-objects could be shared, that would yield wrong
> results.
>
>> class Person
>>
>> string NameLast
>> string NameFirst
>> Address AddressHome
>> Address AddressWork
>>
>> end class
>>
>> class Address
>> string Street
>> string State
>> string City
>> string Zip
>> end class
>>
> Only the individual strings would be candidates for the LOH; the Person
> and Address instances never are because they're far shy of the 85,000
> bytes threshold. And it's also pretty unlikely that you'll have strings
> bigger than 85K...
>
> --
> J.