protected void resetActive() {
    // Record the MutableSegment' heap overhead when initialing
    MemStoreSizing memstoreAccounting = new NonThreadSafeMemStoreSizing();
    // Reset heap to not include any keys
    active = SegmentFactory.instance().createMutableSegment(conf, comparator, memstoreAccounting);
    // regionServices can be null when testing
    if (regionServices != null) {
      regionServices.addMemStoreSize(memstoreAccounting.getDataSize(),
        memstoreAccounting.getHeapSize(), memstoreAccounting.getOffHeapSize(),
        memstoreAccounting.getCellsCount());
    }
  }
An abstract class, which implements the behaviour shared by all concrete memstore instances.
hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/AbstractMemStore.java