低CPU占用Java嵌入式数据库
这是我在基于java磁盘的哈希映射针对基于磁盘的哈希映射提出的问题的后续内容。
建议的解决方案可行,但 CPU 成本较高。我尝试过使用一些嵌入式数据库,包括 hsqldb 和 derby 以及 java 中的 sqllite 实现。
对于我尝试过的大多数方法来说,所有这些都完成了工作,但速度相当慢,我提到的三个是最好的。然而,我遇到了所有这些问题。 启动和维护每个嵌入式数据库需要大量的 CPU 时间,根据任务管理器的说法,我没有提到的数据库大部分时间都使用了 100% 的 CPU。
我的新问题是,是否有任何简单的基于磁盘的存储不会耗尽我的CPU。
根据记录,sqllite 解决方案并没有增加 CPU 使用率,它只是因一系列不同的错误而崩溃。 apache derby 的性能最好,CPU 使用率随之波动,但平均约为 80%
This is a follow up to a question i asked at java disc based hashmap for a disk based hashmap.
The solution suggested works but at a high CPU cost. I've tried using a few embeded databases, including hsqldb and derby as well as an sqllite implementation in java.
The all get the job done, quite slowly for most of the ones i've tried, the three i mentioned beformed the best. I ran into one problem with all of them however.
Starting and maintaining each embeded database required a lot of CPU time, the ones i haven't mentioned used up 100% of the cpu most of the time,according to task manager.
My new question then is, are there any simple disc based storage that won't eat away my cpu.
for the record, the sqllite solution didn't spike cpu usage it was just crashing with a range of different errors. And apache derby had the best performance and cpu usage fluctuated with it but on average was about 80%
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
除了 Apache Derby 和 HSQLDB 之外,我没有使用其他嵌入式 java DB 的经验。
一些链接:
您尝试过一些 NoSQL DB 吗?
更新
这里是NoSQL 数据库列表。我对他们没有经验。但MongoDB和CouchDB是相当有名的。而且Db4o 看起来很有趣。
I have no experience with other embedded java DB then Apache Derby and HSQLDB.
Some links:
Did you tried some NoSQL DB?
Update
Here is a list of NoSQL databases. I have no experience with them. But MongoDB and CouchDB are quite famous. And also Db4o looks interesting.
尝试 H2 数据库
Try H2 Database