org.apache.hadoop.hbase.io
Interface HeapSize

All Known Implementing Classes:
CachedBlock, CachedBlockQueue, HRegion, KeyValue, LruBlockCache, LruHashMap, LruHashMap.Entry, MemStore, Put, Store, WALEdit

public interface HeapSize

Implementations can be asked for an estimate of their size in bytes.

Useful for sizing caches. Its a given that implementation approximations do not account for 32 vs 64 bit nor for different VM implementations.

An Object's size is determined by the non-static data members in it, as well as the fixed Object overhead.

For example:

 public class SampleObject implements HeapSize {

   int [] numbers;
   int x;
 }
 


Method Summary
 long heapSize()
           
 

Method Detail

heapSize

long heapSize()
Returns:
Approximate 'exclusive deep size' of implementing object. Includes count of payload and hosting object sizings.


Copyright © 2011 The Apache Software Foundation. All Rights Reserved.