java.lang.OutOfMemoryError: Java heap space

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,
via oracle.com by Unknown author

An easy way to solve OutOfMemoryError in java is to increase the maximum heap size by using JVM options -Xmx512M, this will immediately solve your OutOfMemoryError.

,
via Stack Overflow by Eugene Yokota

In Eclipse : go to Run --> Run Configurations --> then select the project under maven build --> then select the tab "JRE" --> then enter -Xmx1024m

This should increase the memory heap for all the builds/projects. The above memory size is 1 GB

Solutions on the web

java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2367)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:114)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:415)
at java.lang.StringBuilder.append(StringBuilder.java:132)
at nl.inl.blacklab.externalstorage.ContentStoreDirUtf8.addToBlock(ContentStoreDirUtf8.java:474)
at nl.inl.blacklab.externalstorage.ContentStoreDirUtf8.storePart(ContentStoreDirUtf8.java:560)
at nl.inl.blacklab.index.DocIndexerAbstract.storePartCapturedContent(DocIndexerAbstract.java:138)
at nl.inl.blacklab.index.DocIndexerAbstract.appendContent(DocIndexerAbstract.java:156)
at nl.inl.blacklab.index.DocIndexerAbstract.processContent(DocIndexerAbstract.java:180)
at nl.inl.blacklab.index.DocIndexerXmlHandlers.endElement(DocIndexerXmlHandlers.java:691)
at nl.inl.blacklab.index.DocIndexerXmlHandlers$SaxParseHandler.endElement(DocIndexerXmlHandlers.java:760)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:609)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1789)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2965)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:649)
at nl.inl.blacklab.index.DocIndexerXmlHandlers.index(DocIndexerXmlHandlers.java:725)
at nl.inl.blacklab.index.Indexer.index(Indexer.java:348)
at nl.inl.blacklab.index.Indexer.indexInputStream(Indexer.java:510)
at nl.inl.blacklab.index.Indexer.indexInternal(Indexer.java:475)
at nl.inl.blacklab.index.Indexer.index(Indexer.java:388)
at nl.inl.blacklab.tools.IndexTool.main(IndexTool.java:266)

Users with the same issue

Once, 5 months ago
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago
61 more bugmates

Know the solutions? Share your knowledge to help other developers to debug faster.