Question: what is the difference between shallow heap and retained heap?
Answer: In general terms, the shallow heap of an object is the size of the object in the heap. The retained size of the same object is the amount of heap memory that is freed when the object is garbage collected.