There is Large Object Heap in .NET for objects with size more than 85kb. As I understand size of object in heap calculated like this
- size of all properties and fields of primitive types and instances of value types (because they are stored inside parent instance)
- size of references to other instances of classes (because they are stored separately).
Examples:
- 10 objects of reference type (each 10kb) and one object of reference type which contains all of them => all objects should not be put into LOH
- 2 objects of reference type (each 86kb) and object of reference type which contains all of them => 2 objects in LOH but last one in usual heap
Is it correct calculation schema? Are my examples correct?