public long getBucketSize(int bucketId) {
    // This is an approximate calculation, so we don't require the
    // bucket to be fully initialized...
    // getInitializedBucketForId(Long.valueOf(bucketId)); // wait for the bucket to finish
    // initializing
    final BucketRegion bucketRegion = localBucket2RegionMap.get(bucketId);
    if (bucketRegion == null) {
      return 0;
    }
    return bucketRegion.getTotalBytes();
  }
Return the size in bytes for a given bucket.

@return size in bytes
geode-core/src/main/java/org/apache/geode/internal/cache/PartitionedRegionDataStore.java