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

via Jenkins JIRA by Greg Moncreaff, 1 year ago
Java heap space
via Jenkins JIRA by Greg Moncreaff, 1 year ago
Java heap space
via Stack Overflow by pstanton
, 2 years ago
via Stack Overflow by kylebb
, 2 years ago
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2882)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:100)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:515)
at java.lang.StringBuilder.append(StringBuilder.java:189)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.characters(AbstractSAXParser.java:538)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:464)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at org.apache.commons.digester3.Digester.parse(Digester.java:1642)
at hudson.plugins.dry.parser.cpd.CpdParser.parse(CpdParser.java:86)
at hudson.plugins.dry.parser.DuplicationParserRegistry.parse(DuplicationParserRegistry.java:73)
at hudson.plugins.analysis.core.FilesParser.parseFile(FilesParser.java:358)
at hudson.plugins.analysis.core.FilesParser.parseFiles(FilesParser.java:317)
at hudson.plugins.analysis.core.FilesParser.invoke(FilesParser.java:266)
at hudson.FilePath.act(FilePath.java:788)
at hudson.FilePath.act(FilePath.java:770)
at hudson.plugins.dry.DryPublisher.perform(DryPublisher.java:171)
at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:19)
at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:700)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:675)
at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:653)
at hudson.model.Build$RunnerImpl.post2(Build.java:162)
at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:622)
at hudson.model.Run.run(Run.java:1434)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)

Users with the same issue

2 times, 1 day ago
3 times, 1 month ago
Once, 2 months ago
Once, 2 months ago
2 times, 3 months ago

Write tip

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