berkeley db java使用

hmsuccess hmsuccess 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
有没有使用过berkeley db java edition的高手,现有一个问题急需解决,特在此寻求帮助。

问题如下:
现需要向数据库中插入大概5000w条记录,数据项的key为String类型,data为自定义的A类型,处理的过程中发现数据库的日志文件(*.jdb)越来越大,直达50G,直接将我的硬盘撑爆,太恐怖了~~~,有没有解决的方法。

在此,先感谢所有提供意见的朋友!

我的je配置如下:

# If true (default is false) NIO is used for all file I/O.
je.log.useNIO=true

# If non-0 (default is 0) break all IO into chunks of this size.
# This setting is only used if je.log.useNIO=true.
# minimum = 0
# maximum = 67108864
je.log.chunkedNIO=8192

# If true (default is false) direct NIO buffers are used.
# This setting is only used if je.log.useNIO=true.
je.log.directNIO=true

# The maximum size of each individual JE log file, in bytes.
# minimum = 1000000
# maximum = 4294967296
# 100M
je.log.fileMax=104857600

# maximum starting size of a JE log buffer
# 32M
je.log.bufferSize=33554432

# The number of JE log buffers
# minimum = 2
je.log.numBuffers=2

# The total memory taken by log buffers, in bytes. If 0, use
# 7% of je.maxMemory
# minimum = 6144
# 32M * 2
je.log.totalBufferBytes=67108864

# By default, JE sizes the cache as a percentage of the maximum
# memory available to the JVM. For example, if the JVM is
# started with -Xmx128M, the cache size will be
# (je.maxMemoryPercent * 128M) / 100
# Setting je.maxMemory to an non-zero value will override
# je.maxMemoryPercent
# minimum = 1
# maximum = 90
je.maxMemoryPercent=60

# If true (the default), use an LRU-only policy to select nodes for
# eviction. If false, select by Btree level first, and then by LRU.
je.evictor.lruOnly=false

# The number of nodes in one evictor scan
# minimum = 1
# maximum = 1000
je.evictor.nodesPerScan=100

# The cleaner will keep the total disk space utilization percentage
# above this value. The default is set to 50 percent.
# minimum = 0
# maximum = 90
je.cleaner.minUtilization=90
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
hmsuccess
Java SE 62,621 成员 307,251 内容