Every time the code needs to know how much resource of a particular type is available (or how much space is available) it creates a new List object (which also allocates its internal array usually with the default initial capacity of 4) and scans through the whole vessel adding each Part's sub-objects that represent that resource in the part to the list.  This should only be adding the references to the list but the PartResourceList.GetAll function (called from Part.GetConnectedResources) itself
    • Like
    4