use fixed-size mapdb cache to avoid heap growing uncontrollably

This commit is contained in:
Xavier Léauté 2014-12-05 15:34:50 -08:00
parent 40f223215a
commit ad23e49777
1 changed files with 3 additions and 1 deletions

View File

@ -109,7 +109,9 @@ public class OffheapIncrementalIndex extends IncrementalIndex<BufferAggregator>
final DBMaker dbMaker = DBMaker.newMemoryDirectDB() final DBMaker dbMaker = DBMaker.newMemoryDirectDB()
.transactionDisable() .transactionDisable()
.asyncWriteEnable() .asyncWriteEnable()
.cacheSoftRefEnable(); .cacheLRUEnable()
.cacheSize(16384);
this.factsDb = dbMaker.make(); this.factsDb = dbMaker.make();
this.db = dbMaker.make(); this.db = dbMaker.make();
final TimeAndDimsSerializer timeAndDimsSerializer = new TimeAndDimsSerializer(this); final TimeAndDimsSerializer timeAndDimsSerializer = new TimeAndDimsSerializer(this);