MCPcopy Create free account
hub / github.com/apache/pig / getMapEntrySize

Method getMapEntrySize

src/org/apache/pig/data/SizeUtil.java:111–120  ·  view source on GitHub ↗
(Object key, Object value)

Source from the content-addressed store, hash-verified

109 }
110
111 public static long getMapEntrySize(Object key, Object value) {
112 // based on experiments on 32 bit Java HotSpot VM
113 // size of map with 0 entries is 120 bytes
114 // each additional entry have around 24 bytes overhead at
115 // small number of entries. At larger number of entries, the
116 // overhead is around 32 bytes, probably because of the expanded
117 // data structures in anticapation of more entries being added
118 return getPigObjMemSize(key) + getPigObjMemSize(value)
119 + MAP_MEM_PER_ENTRY;
120 }
121
122 /**
123 * Memory size of objects are rounded to multiple of 8 bytes

Callers 1

getPigObjMemSizeMethod · 0.95

Calls 1

getPigObjMemSizeMethod · 0.95

Tested by

no test coverage detected