@Override
  public MemStoreSize size() {
    MemStoreSizing memstoreSizing = new NonThreadSafeMemStoreSizing();
    memstoreSizing.incMemStoreSize(getActive().getMemStoreSize());
    for (Segment item : pipeline.getSegments()) {
      memstoreSizing.incMemStoreSize(item.getMemStoreSize());
    }
    return memstoreSizing.getMemStoreSize();
  }
@return Total memory occupied by this MemStore. This won't include any size occupied by the
        snapshot. We assume the snapshot will get cleared soon. This is not thread safe and the
        memstore may be changed while computing its size. It is the responsibility of the
        caller to make sure this doesn't happen.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/CompactingMemStore.java