MapDBLog: reduce cache size
Change-Id: I4a3ba607e85fb1ac1b350ca84bfa88a51a59773e
Showing
1 changed file
with
4 additions
and
0 deletions
... | @@ -41,6 +41,8 @@ public class MapDBLog implements Log { | ... | @@ -41,6 +41,8 @@ public class MapDBLog implements Log { |
41 | private static final String LOG_NAME = "log"; | 41 | private static final String LOG_NAME = "log"; |
42 | private static final String SIZE_FIELD_NAME = "size"; | 42 | private static final String SIZE_FIELD_NAME = "size"; |
43 | 43 | ||
44 | + private int cacheSize = 256; | ||
45 | + | ||
44 | public MapDBLog(String dbFileName, StoreSerializer serializer) { | 46 | public MapDBLog(String dbFileName, StoreSerializer serializer) { |
45 | this.dbFile = new File(dbFileName); | 47 | this.dbFile = new File(dbFileName); |
46 | this.serializer = serializer; | 48 | this.serializer = serializer; |
... | @@ -50,6 +52,8 @@ public class MapDBLog implements Log { | ... | @@ -50,6 +52,8 @@ public class MapDBLog implements Log { |
50 | public void open() throws IOException { | 52 | public void open() throws IOException { |
51 | txMaker = DBMaker | 53 | txMaker = DBMaker |
52 | .newFileDB(dbFile) | 54 | .newFileDB(dbFile) |
55 | + .cacheLRUEnable() | ||
56 | + .cacheSize(cacheSize) | ||
53 | .makeTxMaker(); | 57 | .makeTxMaker(); |
54 | } | 58 | } |
55 | 59 | ... | ... |
-
Please register or login to post a comment