need help~~!
Hi, I need a solution. Environment is like this, I have about 40 million of the number of groups, example as 12345678:abc, I need to put into the memory of storage and query. Because there is a time limit, each query is not longer than 200ms. I use the htreemap MapDB off heap, load 1 Million number group every 10 seconds. But there are some problems, in the process, I need to update the number of these numbers, I have close DB operation. Then re create a new DB to load, this time the user has a query, it throws a OUTOFMEMORY exception. So I would like to ask, in this case, MapDB have any good solution? I have also tried, first not close db, such as loading the original DB to the original close. But the same throw OUTOFMEMORY.so i need help, let system can reload, and can successfully query.
How do you startup mapdb?
use the example:
//first create store DB db = DBMaker .memoryDirectDB() // make it faster .transactionDisable() //some additional options for DB // .asyncWriteEnable() // .cacheSize(100000) .make();
HTreeMap cache = db
.hashMapCreate("cache")
.expireStoreSize(4G)
.keySerializer(Serializer.STRING)
.valueSerializer(Serializer.STRING)
.make();
Do you call commit?
no~~i just new a db , and put the number gruop in htreemap
You need to call commit from time to time.
oh~~i see. thx. but why i close this map , this off heap can't clear the memory ?
Try .cacheDisable().