I am using the Visual Studio Performance Tools in an attempt to discover why my program is running out of memory. After guessing what to do I have produced this display:-
It seems to suggest here that the size of the object includes the object only and the inclusive size includes all the objects that object references. But the objects concerned are defined like this:-
Public Structure Temperature
Implements IMeasurements, IComparable(Of Temperature)
Private Const KELVIN_TO_CENTIGRADE As Double = 273.15
Private temperature As Double
Friend Sub New(ByVal passed_temperature As Double)
temperature = passed_temperature
End Sub
' some other methods, operator overloads and the IComparable
' implementation
End Structure
so the sizes clearly don't mean that unless there is a staggering amount of wasted space associated with these structures.
So, does anyone know what this is all about? Am I completely missing the point here?
According to my experiments Size and Inclusive size are what is written on Visual Studio tooltips:
Total size of the objects in memory
and
Total size of the objects plus total size of all child objects
But for me most important things to understand are:
Total size is visible size of object + overhead. This means that the following class takes 24 bytes on x64.
class X {}
Inclusive size does not process children of value types. This means if your class has child of value type then objects that are referenced from latter are not calculated.
Size is the object with simple data types. Inclusive is the object plus sub objects size.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With