fix memory problem; inconsistent counters in large partitions