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 JIRA by JM, 1 year ago
Requested array size exceeds VM limit
via JIRA by JM, 1 year ago
Requested array size exceeds VM limit
via GitHub by vladak
, 2 years ago
Requested array size exceeds VM limit
via sourceforge.net by Unknown author, 1 year ago
Requested array size exceeds VM limit
java.lang.OutOfMemoryError: Requested array size exceeds VM limit
at java.util.Arrays.copyOf(Arrays.java:2367)
at java.lang.AbstractStringBuilder.expandCapacity(AbstractStringBuilder.java:130)
at java.lang.StringBuilder.append(StringBuilder.java:143)
at java.lang.StringBuilder.append(StringBuilder.java:183)
at water.util.SB.p(SB.java:128)
at hex.tree.TreeJCodeGen.generate(TreeJCodeGen.java:105)
at hex.tree.SharedTreeModel.toJavaPredictBody(SharedTreeModel.java:231)
at hex.Model.toJavaPredict(Model.java:1014)
at hex.Model.toJava(Model.java:932)
at hex.Model.toJava(Model.java:881)
at water.api.ModelSchema.toJava(ModelSchema.java:126)
at water.api.RequestServer.wrap(RequestServer.java:679)
at water.api.RequestServer.serve(RequestServer.java:580)
at water.JettyHTTPD$H2oDefaultServlet.doGeneric(JettyHTTPD.java:617)
at water.JettyHTTPD$H2oDefaultServlet.doGet(JettyHTTPD.java:559)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:735)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:684)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:503)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1086)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:429)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1020)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:370)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:494)

Users with the same issue

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

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