MATLAB: How matlab stores graphics objects

dataMATLAB

when i create a figure i noticed that it have alot of propeties and each property hold values,
that means alot of bytes, but the figure size seems to be 8 bytes despite all the properties values which are having a greater size,
my question is if properties values are not stored on (RAM), then where the properties values are stored then, and how matlab calls them that fast if they are really not stored on RAM.
please don't give me links, and thanks in advance

Best Answer

The Bytes column of the output of whos does not tell the "truth, whole truth, and nothing but the truth" for certain situations.
A = zeros(100);
B = A;
whos A B
Name Size Bytes Class Attributes A 100x100 80000 double B 100x100 80000 double
A and B do not necessarily point to a different block of 80,000 bytes due to the copy-on-write behavior of MATLAB.
f = figure;
whos f
Name Size Bytes Class Attributes f 1x1 8 matlab.ui.Figure
This does not list the full amount of memory required to store all the data and properties associated with a figure window.
Use that data as guidance, not law.
And no, there is no way to get the actual amount of memory associated with f (maybe walking the list of properties in a MEX-file, but again things like copy-on-write would complicate even that.)