and DirectByteBuffer
version was tested on half-terabyte of memory.
There is also _heap
mode where MapDB stores all data on-heap using pointers and object instances. There is no serialization involved. This mode is usually faster for smaller sets, but is limited by Garbage Collection.
This chart shows how much entries Map<Long,UUID>
can fit into 5GB of heap memory. JVM starts with 5GB maximal heap size (-Xmx5G
), entries are added until JVM terminates with OutOfMemoryException
.
ConcurrentHashMap and ConcurrentSkipListMap are bundled with Java. Their both consume about the same amount of memory.
BTreeMap should have in theory very good space usage. However underlying store is too fragmented after frequent updates, this bug should be solved soon. BTreeMap_pump
shows best case for BTreeMap, with no fragmentation.
BTreeMap_heap
is on-heap version of BTreeMap. It uses specialized node representation (Long[]
and UUID[]
are internally stored in long[]
) and that makes it space efficient.
HTreeMap is not yet optimized for space usage, no surprise here.
SortedTableMap is very space efficient after compaction.
ConcurrentHashMap
in this case rocks .
HTreeMap
and BTreeMap
are relatively slow. Optimizations are planned for M4.
ConcurrentHashMap
rocks again.
BTreeMap_heap
takes advantage of specialization (it uses long[]
instead of Long[]
in BTree Nodes).
HTreeMap
and BTreeMap
are relatively slow. Optimizations are planned for M4.