6
我正在爲我的Solr應用程序進行負載測試。該指數有超過2億個文件。我使用默認的Jetty服務器,並將最大的JVM內存設置爲4GB。爲了測試我的應用程序,我編寫了5000個文本查詢並逐個發佈到Solr。但是,在大約110個查詢之後,Jetty容器將引發異常。爲什麼這種情況一直髮生? Solr OutOfMemoryError超出GC開銷限制
爲什麼會發生這種情況?我該如何解決它?
SEVERE: java.lang.OutOfMemoryError: GC overhead limit exceeded
at org.apache.lucene.util.AttributeImpl.clone(AttributeImpl.java:196)
at org.apache.lucene.util.AttributeSource$State.clone(AttributeSource.java:116)
at org.apache.lucene.util.AttributeSource$State.clone(AttributeSource.java:119)
at org.apache.lucene.util.AttributeSource.captureState(AttributeSource.java:349)
at org.apache.solr.highlight.TokenOrderingFilter.incrementToken(DefaultSolrHighlighter.java:595)
at org.apache.lucene.search.highlight.OffsetLimitTokenFilter.incrementToken(OffsetLimitTokenFilter.java:43)
at org.apache.lucene.analysis.CachingTokenFilter.fillCache(CachingTokenFilter.java:78)
at org.apache.lucene.analysis.CachingTokenFilter.incrementToken(CachingTokenFilter.java:50)
at org.apache.lucene.search.highlight.Highlighter.getBestTextFragments(Highlighter.java:225)
at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlightingByHighlighter(DefaultSolrHighlighter.java:468)
at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlighting(DefaultSolrHighlighter.java:379)
at org.apache.solr.handler.component.HighlightComponent.process(HighlightComponent.java:116)
at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:194)
at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
at org.apache.solr.core.SolrCore.execute(SolrCore.java:1368)
at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356)
at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
你有64位的操作系統和64位的Java版本嗎? –
嘗試使用'-Xss4m'增加JVM堆棧。 –
我只是想出來。它是由低級Lucene緩存引起的。我禁用了該代碼。然後它工作。 (雖然有點慢) – Xiao