## Shallow Size and Retained Size

Shallow Size and Retained Size 的含义都是指的实例对象，不是类本身。

### Shallow Size 含义

Shallow Size 就是对象本身所占用的大小，不包括其引用的对象。

### Retained Size 含义

#### 针对可达对象

Retained Size的含义相对于Shallow Size 不太好理解。依然是上面的例子，在不同的情况下，sampleClass 的Retained Size 并不相同。下面引用StackOverFlow上的一个回答来解释这个问题。

Retained size of an object is its shallow size plus the shallow sizes of the objects that are accessible, directly or indirectly, only from this object. In other words, the retained size represents the amount of memory that will be freed by the garbage collector when this object is collected.