Three integers are pasted in but "private int length" is already taken care of by
//Size of int length > ClassSize.align(length) + So only 2 more integers are left right ? On Mon, Aug 1, 2011 at 10:37 AM, Ryan Rawson <[email protected]> wrote: > Each array is really a pointer to an array (hence the references), > then we are taking account of the overhead of the 'bytes' array > itself. > > And I see 3 integers pasted in, so things are looking good to me.... > > On Sun, Jul 31, 2011 at 10:01 PM, Akash Ashok <[email protected]> > wrote: > > Hi, > > I was going thru the heapSize() method in the class KeyValue and i > > couldn't seem to understand a few things which are in bold below > > > > > > private byte [] bytes = null; > > private int offset = 0; > > private int length = 0; > > private int keyLength = 0; > > > > // the row cached > > private byte [] rowCache = null; > > > > // default value is 0, aka DNC > > private long memstoreTS = 0; > > * @return Timestamp > > */ > > private long timestampCache = -1; > > > > > > public long heapSize() { > > return ClassSize.align( > > // Fixed Object size > > ClassSize.OBJECT + > > > > * // Why this ????? > > (2 * ClassSize.REFERENCE) +* > > > > // bytes Array > > ClassSize.align(ClassSize.ARRAY) + > > > > //Size of int length > > ClassSize.align(length) + > > > > * // Why this ?? There are only 2 ints leaving length which are int ( > > offset, length) > > (3 * Bytes.SIZEOF_INT) + > > * > > // rowCache byte array > > ClassSize.align(ClassSize.ARRAY) + > > > > // Accounts for the longs memstoreTS and timestampCache > > (2 * Bytes.SIZEOF_LONG)); > > } > > >
