diff --git a/source/sdk/sdk-samples/pom.xml b/source/sdk/sdk-samples/pom.xml
index ba7d5650..bbf42e53 100644
--- a/source/sdk/sdk-samples/pom.xml
+++ b/source/sdk/sdk-samples/pom.xml
@@ -30,6 +30,11 @@
contract-samples
${project.version}
+
+ org.bouncycastle
+ bcpkix-jdk15on
+ 1.61
+
diff --git a/source/storage/storage-rocksdb/src/main/java/com/jd/blockchain/storage/service/impl/rocksdb/RocksDBConnectionFactory.java b/source/storage/storage-rocksdb/src/main/java/com/jd/blockchain/storage/service/impl/rocksdb/RocksDBConnectionFactory.java
index ba7f7702..eab7f7f4 100644
--- a/source/storage/storage-rocksdb/src/main/java/com/jd/blockchain/storage/service/impl/rocksdb/RocksDBConnectionFactory.java
+++ b/source/storage/storage-rocksdb/src/main/java/com/jd/blockchain/storage/service/impl/rocksdb/RocksDBConnectionFactory.java
@@ -120,32 +120,27 @@ public class RocksDBConnectionFactory implements DbConnectionFactory {
System.out.printf("optionMaxBackgroundCompactions = %s \r\n", optionMaxBackgroundCompactions);
System.out.printf("optionMaxBackgroundFlushes = %s \r\n", optionMaxBackgroundFlushes);
-
-
-
- Cache cache = new LRUCache(cacheCapacity, cacheNumShardBits, false);
- final BlockBasedTableConfig tableOptions = new BlockBasedTableConfig()
- .setBlockCache(cache)
- .setBlockSize(tableBlockSize)
- .setMetadataBlockSize(tableMetadataBlockSize)
- .setCacheIndexAndFilterBlocks(true) // 设置索引和布隆过滤器使用Block Cache内存
- .setCacheIndexAndFilterBlocksWithHighPriority(true)
- .setIndexType(IndexType.kTwoLevelIndexSearch) // 设置两级索引,控制索引占用内存
- .setFilterPolicy(new BloomFilter(tableBloomBitsPerKey, false)) // 设置布隆过滤器
- ;
- Options options = new Options()
- // 最多占用256 * 7 + 512 = 2G+内存
- .setWriteBufferSize(optionWriteBufferSize)
- .setMaxWriteBufferNumber(optionMaxWriteBufferNumber)
- .setMinWriteBufferNumberToMerge(optionMinWriteBufferNumberToMerge)
- .setMaxOpenFiles(optionMaxOpenFiles) // 控制最大打开文件数量,防止内存持续增加
- .setAllowConcurrentMemtableWrite(true) //允许并行Memtable写入
- .setCreateIfMissing(true)
- .setTableFormatConfig(tableOptions)
- .setMaxBackgroundCompactions(optionMaxBackgroundCompactions)
- .setMaxBackgroundFlushes(optionMaxBackgroundFlushes)
- ;
- return options;
+ Cache cache = new LRUCache(512 * SizeUnit.MB);
+
+ final BlockBasedTableConfig tableOptions = new BlockBasedTableConfig()
+ .setBlockCache(cache)
+ .setCacheIndexAndFilterBlocks(true)
+ ;
+
+ Options options = new Options()
+ // 最多占用256 * 7 + 512 = 2.25G内存
+ .setWriteBufferSize(256 * SizeUnit.MB)
+ .setMaxWriteBufferNumber(7)
+ .setMinWriteBufferNumberToMerge(2)
+ .setMaxOpenFiles(-1)
+ .setAllowConcurrentMemtableWrite(true)
+ .setCreateIfMissing(true)
+ .setTableFormatConfig(tableOptions)
+ .setMaxBackgroundCompactions(5)
+ .setMaxBackgroundFlushes(4)
+ .setMemTableConfig(new SkipListMemTableConfig())
+ ;
+ return options;
}
/**