gpt4 book ai didi

java "OutOfMemory Error"耶拿应用程序

转载 作者:行者123 更新时间:2023-12-01 11:45:52 28 4
gpt4 key购买 nike

我正在尝试使用 Jena 的读取方法来读取大尺寸数据集(超过 1 GB),但收到内存不足错误。我尝试将 tomcat 堆大小(-Xmx 参数)增加到 2048,这也是 eclipse.ini 文件中的相同参数。但是我无法找到可行的解决方案我愿意接受有关如何处理大型数据集的任何建议,因为我将把数据集解析为 HashMap 并在网页上显示内容。

控制台错误如下:

Exception in thread "http-bio-8080-AsyncTimeout" java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.concurrent.ConcurrentLinkedQueue.iterator(ConcurrentLinkedQueue.java:667)
at org.apache.tomcat.util.net.JIoEndpoint$AsyncTimeout.run(JIoEndpoint.java:157)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "http-bio-8080-exec-6" java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.concurrent.CopyOnWriteArrayList.iterator(CopyOnWriteArrayList.java:959)
at com.hp.hpl.jena.graph.impl.SimpleEventManager.notifyAddTriple(SimpleEventManager.java:91)
at com.hp.hpl.jena.graph.impl.GraphBase.notifyAdd(GraphBase.java:124)
at com.hp.hpl.jena.graph.impl.GraphBase.add(GraphBase.java:203)
at org.apache.jena.riot.system.StreamRDFLib$ParserOutputGraph.triple(StreamRDFLib.java:165)
at org.apache.jena.riot.lang.LangNTriples.runParser(LangNTriples.java:56)
at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
at org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:182)
at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:906)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:257)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
at org.apache.jena.riot.adapters.RDFReaderRIOT_Web.read(RDFReaderRIOT_Web.java:96)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:235)
at com.packages.rdf.FileAnalyse.GetFileComponents(FileAnalyse.java:77)
at com.packages.servlets.CreatePatternServlet.GetStatements(CreatePatternServlet.java:96)
at com.packages.servlets.CreatePatternServlet.doPost(CreatePatternServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)

Exception in thread "ContainerBackgroundProcessor[StandardEngine[Catalina]]" java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.apache.naming.resources.FileDirContext.file(FileDirContext.java:765)
at org.apache.naming.resources.FileDirContext.doGetAttributes(FileDirContext.java:398)
at org.apache.naming.resources.BaseDirContext.getAttributes(BaseDirContext.java:1137)
at org.apache.naming.resources.BaseDirContext.getAttributes(BaseDirContext.java:1090)
at org.apache.naming.resources.ProxyDirContext.getAttributes(ProxyDirContext.java:882)
at org.apache.catalina.loader.WebappClassLoader.modified(WebappClassLoader.java:1026)
at org.apache.catalina.loader.WebappLoader.modified(WebappLoader.java:500)
at org.apache.catalina.loader.WebappLoader.backgroundProcess(WebappLoader.java:420)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1345)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1546)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1556)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1556)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1524)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "http-bio-8080-exec-6" java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.apache.jena.riot.tokens.TokenizerText.parseToken(TokenizerText.java:170)
at org.apache.jena.riot.tokens.TokenizerText.hasNext(TokenizerText.java:86)
at org.apache.jena.atlas.iterator.PeekIterator.fill(PeekIterator.java:50)
at org.apache.jena.atlas.iterator.PeekIterator.next(PeekIterator.java:92)
at org.apache.jena.riot.lang.LangEngine.nextToken(LangEngine.java:99)
at org.apache.jena.riot.lang.LangNTriples.parseOne(LangNTriples.java:71)
at org.apache.jena.riot.lang.LangNTriples.runParser(LangNTriples.java:54)
at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
at org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:182)
at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:906)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:257)
at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:243)
at org.apache.jena.riot.adapters.RDFReaderRIOT_Web.read(RDFReaderRIOT_Web.java:96)
at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:235)
at com.packages.rdf.FileAnalyse.GetFileComponents(FileAnalyse.java:77)
at com.packages.servlets.CreatePatternServlet.GetStatements(CreatePatternServlet.java:96)
at com.packages.servlets.CreatePatternServlet.doPost(CreatePatternServlet.java:68)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:950)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)

最佳答案

看这个: GC overhead limit exceeded

<小时/>

我认为你绝对应该自定义GC。阅读有关 gc 实现的 Oracle 文章,也许您会有所进展。

关于java "OutOfMemory Error"耶拿应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29133566/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com