java.lang.OutOfMemoryError: Requested array size exceeds VM limit

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 Google Groups by Peter Luttrell, 1 year ago
via Stack Overflow by joshuar
, 1 year ago
Requested array size exceeds VM limit
via Stack Overflow by umainyosu
, 1 year ago
via pentaho.com by Unknown author, 1 year ago
Requested array size exceeds VM limit java.util.Arrays.copyOf(Arrays.java:3332) java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137) java.lang.AbstractStringBuilder.ensureCapacityInternal
via GitHub by julie-sullivan
, 2 years ago
Requested array size exceeds VM limit
java.lang.OutOfMemoryError: Requested array size exceeds VM limit
at java.util.Arrays.copyOf(Arrays.java:3332)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:137)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:121)
at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:569)
at java.lang.StringBuffer.append(StringBuffer.java:369)
at java.io.BufferedReader.readLine(BufferedReader.java:370)
at java.io.BufferedReader.readLine(BufferedReader.java:389)
at scala.io.BufferedSource$BufferedLineIterator.hasNext(BufferedSource.scala:72)
at scala.collection.Iterator$JoinIterator.hasNext(Iterator.scala:211)
at scala.collection.Iterator$ConcatIterator.hasNext(Iterator.scala:192)
at scala.collection.Iterator$class.foreach(Iterator.scala:893)
at io.gatling.charts.stats.LogFileReader.firstPass(LogFileReader.scala:86)
at io.gatling.charts.stats.LogFileReader.io$gatling$charts$stats$LogFileReader$$$anonfun$8(LogFileReader.scala:125)
at io.gatling.charts.stats.LogFileReader$lambda$$x1$1.apply(LogFileReader.scala:125)
at io.gatling.charts.stats.LogFileReader$lambda$$x1$1.apply(LogFileReader.scala:125)
at io.gatling.charts.stats.LogFileReader.parseInputFiles(LogFileReader.scala:63)
at io.gatling.charts.stats.LogFileReader.(LogFileReader.scala:125)
at io.gatling.app.LogFileProcessor.initLogFileReader(RunResultProcessor.scala:55)
at io.gatling.app.LogFileProcessor.processRunResult(RunResultProcessor.scala:37)
at io.gatling.app.Gatling.start(Gatling.scala:66)
at io.gatling.app.Gatling$.start(Gatling.scala:57)
at io.gatling.app.Gatling$.fromArgs(Gatling.scala:49)
at io.gatling.app.Gatling$.main(Gatling.scala:43)
at io.gatling.app.Gatling.main(Gatling.scala)

Users with the same issue

Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 3 years ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago
Once, 1 day ago
Samebug visitor profile picture
Unknown user
Once, 2 days ago

Write tip

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