(Object key, Object value)
| 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 |
no test coverage detected