Detects the buffer size for each data bucket before flushing. So that we avoid flushing data buckets with few records.