我的情景,
我在Mysql DB中有一些交易细节。我使用WSO2 ESB服务器并将这些数据推送到WSO2 DAS服务器(使用主键和索引将数据保存在H2 DB中)。数据已成功加载到DAS服务器,但我遇到的问题是,我每三秒钟就会在DAS控制台中看到一个ERROR。错误如下所示。
[2016-04-21 09:09:48,175] ERROR {org.wso2.carbon.analytics.dataservice.core.indexing.AnalyticsDataIndexer} - Error in p
rocessing index batch operations: Error in index data peekNext: Map failed
org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException: Error in index data peekNext: Map failed
at org.wso2.carbon.analytics.dataservice.core.indexing.LocalIndexDataStore$LocalIndexDataQueue.peekNext(LocalInd
exDataStore.java:287)
at org.wso2.carbon.analytics.dataservice.core.indexing.AnalyticsDataIndexer.processLocalShardDataQueue(Analytics
DataIndexer.java:297)
at org.wso2.carbon.analytics.dataservice.core.indexing.AnalyticsDataIndexer.processIndexOperations(AnalyticsData
Indexer.java:261)
at org.wso2.carbon.analytics.dataservice.core.indexing.AnalyticsDataIndexer.access$200(AnalyticsDataIndexer.java
:141)
at org.wso2.carbon.analytics.dataservice.core.indexing.AnalyticsDataIndexer$IndexWorker.run(AnalyticsDataIndexer
.java:1865)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Map failed
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:888)
at com.leansoft.bigqueue.page.MappedPageFactoryImpl.acquirePage(MappedPageFactoryImpl.java:86)
at com.leansoft.bigqueue.BigArrayImpl.append(BigArrayImpl.java:325)
at com.leansoft.bigqueue.BigQueueImpl.enqueue(BigQueueImpl.java:92)
at org.wso2.carbon.analytics.dataservice.core.indexing.LocalIndexDataStore$LocalIndexDataQueue.peekNext(LocalInd
exDataStore.java:271)
... 7 more
Caused by: java.lang.OutOfMemoryError: Map failed
at sun.nio.ch.FileChannelImpl.map0(Native Method)
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:885)
... 11 more
我不确定为什么会这样。请提前帮助和谢谢。
答案 0 :(得分:1)
这是因为您正在使用内存数据库中的H2并使用内存映射文件。我们不建议在生产部署中使用H2。
在将大文件映射到内存时通常会出现此错误,例如尝试映射大于1或2GB的文件
您还可以使用-d64
和-XX:MaxDirectMemorySize
JVM选项来启用大型直接缓冲区