Hi,
MapDB now has DirectMemory storage.
I made little test to compare our two libraries + java.util.TreeMap
All tests are on 64bit Linux, 16GB RAM, JDK6. Default JVM settings.
Source code is here:
https://github.com/jankotek/mapdb-junk/tree/master/src/main/java/directMemoryBenchmark
First is performance test. How long does it take to insert and fetch 1
million records, each 1KB large.
- DM - 6901 ms
- MapDB - 2045 ms
- java.util.TreeMap - 940 ms
Second is overhead test. It inserts pair of integers in cycle, until JVM
runs out of memory.
It should measure how much memory library each consumes for its own
structures.
- DM - inserts 9 000 000 records and then it becomes very slow.
Profiler shows high GC activity.
- MapDB - works about 10 minutes and than it runs out of memory with
217 000 000 records.
- java.util.TreeMap - crashes after 99 000 000 records , it consumed
about 12GB heap.
I am not sure I configured DM correctly, JVM kept crashing when I
increased size too much.
I ended with this setting:
CacheService<Object, Object> m = new DirectMemory<Object, Object>()
.setNumberOfBuffers( 30 )
.setSize((int) 1e8)
.setInitialCapacity( 10000 )
.setConcurrencyLevel( 4 )
.setDisposalTime(1000000)
.newCacheService();
Hope this helps.
Jan