简体   繁体   English

BerkeleyDB-Core-JAVA 中的内存日志缓冲区大小

[英]In-memory log buffer size in BerkeleyDB-Core-JAVA

I'm using in-memory log buffer in Berkeley BerkeleyDB-Core-JAVA edition.我在 Berkeley BerkeleyDB-Core-JAVA 版中使用内存日志缓冲区。 I have CDRFile of 9 lack records.我有 9 个缺少记录的 CDRFile。 When I am writing CDRFile in database in durable database environment(ie log files are created) then total 1.08gb of log files are created and when I am setting this two parameters of in memory log buffer:当我在持久数据库环境中的数据库中写入 CDRFile(即创建日志文件)时,将创建总共 1.08gb 的日志文件,并且当我在 memory 日志缓冲区中设置这两个参数时:

envconfig.setLogInMemory(true);
envconfig.setLogBufferSize(1181116006); // 1.10 gb

im getting error like:我收到如下错误:

-------------------------error----------------
PANIC: Not enough space
PANIC: DB_RUNRECOVERY: Fatal error, run database recovery
unable to join the environment
DataBase Exceptioncom.sleepycat.db.RunRecoveryException: DB_RUNRECOVERY: Fatal error,
run database recovery: PANIC: DB_RUNRECOVERY: Fatal error, run database recovery
unable to join the environment: DB_RUNRECOVERY: Fatal error, run database recovery
Writing DataBase Exception--->java.lang.NullPointerException
 ------------------------------error----------------------

so I think if 1 gb log of files are created on disk then I must set 1gb of space in buffer memory also for log files.所以我认为如果在磁盘上创建 1 GB 的文件日志,那么我必须在缓冲区 memory 中也为日志文件设置 1 GB 的空间。

this kind of question can usually be answered more quickly on the Berkeley DB forum for Berkeley DB core or the Berkeley DB Java Edition forum for BDB JE on OTN.此类问题通常可以在 Berkeley DB core 的 Berkeley DB论坛或 OTN 上 BDB JE 的 Berkeley DB Java 版论坛上得到更快的回答。

Based on your error message, it looks like you're using Berkeley DB (core) via the Java API.根据您的错误消息,您似乎正在通过 Java API 使用 Berkeley DB(核心)。 My guess is that you're running out of log buffer space.我的猜测是您的日志缓冲区空间不足。 In Berkeley DB the default size for an in-memory log buffer is 1MB.在 Berkeley DB 中,内存中日志缓冲区的默认大小为 1MB。 You can either extend the log buffer to be larger by calling DB_ENV->set_lg_bsize() in C or setlogBufferSize in Java.您可以通过调用C 中的 DB_ENV->set_lg_bsize()Java中的 setlogBufferSize 将日志缓冲区扩展为更大。 Otherwise, you can break up the transaction into smaller chunks so that you don't exceed the size of the log buffer in a single transaction.否则,您可以将事务分解成更小的块,这样您就不会超过单个事务中日志缓冲区的大小。

Do you experience this problem when you don't create the log file in-memory, if you use a smaller transaction or if you allocated a larger in-memory log buffer?当您不在内存中创建日志文件、使用较小的事务或分配了较大的内存日志缓冲区时,您是否会遇到此问题?

I hope that this helps.我希望这个对你有用。

Regards,问候,

Dave戴夫

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM