Mapdb - Maximum size of value

114 views
Skip to first unread message

Nuthan Palegar

unread,
Apr 5, 2018, 2:59:19 PM4/5/18
to MapDB
I am newbie to Mapdb. My product is bundled with MapDb version 1.0.9 and cannot migrate to latest for now hence dealing with the same.

I have a use case where would like to store Object onto Map db off-heap and retrieve on the need basis.
My DB configuration works absolutely fine for smaller data sets but not if my object size execeeds ~50MB+

I have tried various configuration like increasing cache size, enabling cacheWeakRefEnable() etc...as suggested by MapDb author nothing is working for me. Please suggest some proper configuration.

Below is my configuration.

DB dbWriter = DBMaker.newFileDB(new File("testmapDb12")).cacheSize(10*1024*1024).cacheWeakRefEnable().make();
Map<Long, Object> samplesMap = dbWriter.createTreeMap("checkDb34").valuesOutsideNodesEnable().makeOrGet();
samplesMap.put(timeStamp,  Object);

DB dbWriter = DBMaker.newFileDB(new File("testmapDb12")).cacheDisable().transactionDisable().make();
Map<Long, Object> samplesMap = dbWriter.createTreeMap("checkDb34").makeOrGet();
samplesMap.put(timeStamp,  Object);

When am trying to put no error is reported but database is never updated. After few iterations am seeing Out-of-Memory-Exceptions.


alla...@utoronto.ca

unread,
Apr 6, 2018, 1:53:18 PM4/6/18
to MapDB
I'm used to using V3.0.5 so my suggestion may not apply.  Try enabling FileChannel.  I use this with hundreds of megabytes with no issues.

Maker dbMaker = DBMaker.fileDB(dbFile).fileChannelEnable();

Nuthan Palegar

unread,
Apr 6, 2018, 2:08:01 PM4/6/18
to MapDB
Thank you for the response. FileChannelEnable is not supported in the version am using.

Anyways was able to crack the issue. The problem was with both the configuration and serialization. Having customer serializer in place its working like charm :) 
DB dbWriter = DBMaker.newFileDB(filePath).cacheWeakRefEnable().closeOnJvmShutdown().make();
Reply all
Reply to author
Forward
0 new messages