对于大部分系统来说,mapdb并无太大价值,而且增加了成本。但是如果一级缓存巨大例如数以十GB级别,或占据了整个JVM的1/2以上,mapdb的价值就会体现出来。正如其官网介绍:
MapDB provides Java Maps, Sets, Lists, Queues and other collections backed by off-heap or on-disk storage. It is a hybrid between java collection framework and embedded database engine.
使用MapDB存储map后,jvm gc的压力就会大大减少。
具体使用可参考:http://www.mapdb.org/down/mapdb-manual-20.pdf