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 JFrog JIRA by Ariel Seftel, 1 year ago
Requested array size exceeds VM limit
via broadinstitute.org by Unknown author, 1 year ago
Requested array size exceeds VM limit
via Google Groups by Chao Li, 5 months ago
via Stack Overflow by Knows Not Much
, 1 year ago
via netbeans.org by Unknown author, 1 year ago
via GitHub by donghwan-shin
, 1 year ago
GC overhead limit exceeded
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:421)
at java.lang.StringBuilder.append(StringBuilder.java:136)
at java.lang.StringBuilder.append(StringBuilder.java:131)
at java.util.AbstractCollection.toString(AbstractCollection.java:462)
at org.artifactory.rest.common.service.ArtifactoryRestResponse.getObject(ArtifactoryRestResponse.java:129)
at org.artifactory.rest.common.service.ArtifactoryRestResponse.getEntity(ArtifactoryRestResponse.java:108)
at org.artifactory.rest.common.util.ResponseHandler.buildJerseyResponse(ResponseHandler.java:38)
at org.artifactory.rest.common.service.ArtifactoryRestResponse.buildResponse(ArtifactoryRestResponse.java:196)
at org.artifactory.rest.common.service.ServiceExecutor.process(ServiceExecutor.java:40)
at org.artifactory.rest.common.resource.BaseResource.runService(BaseResource.java:127)
at org.artifactory.ui.rest.resource.admin.security.user.UserResource.getUser(UserResource.java:116)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
at com.sun.jersey.server.impl.model.method.dispatch.AbstractResourceMethodDispatchProvider$ResponseOutInvoker._dispatch(AbstractResourceMethodDispatchProvider.java:205)
at com.sun.jersey.server.impl.model.method.dispatch.ResourceJavaMethodDispatcher.dispatch(ResourceJavaMethodDispatcher.java:75)
at com.sun.jersey.server.impl.uri.rules.HttpMethodRule.accept(HttpMethodRule.java:302)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.ResourceClassRule.accept(ResourceClassRule.java:108)
at com.sun.jersey.server.impl.uri.rules.RightHandPathRule.accept(RightHandPathRule.java:147)
at com.sun.jersey.server.impl.uri.rules.RootResourceClassesRule.accept(RootResourceClassesRule.java:84)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1542)
at com.sun.jersey.server.impl.application.WebApplicationImpl._handleRequest(WebApplicationImpl.java:1473)
at com.sun.jersey.server.impl.application.WebApplicationImpl.handleRequest(WebApplicationImpl.java:1419)
at com.sun.jersey.spi.container.servlet.WebComponent.service(WebComponent.java:409)

Users with the same issue

Once, 3 weeks ago
22 times, 1 week ago
Once, 2 weeks ago
2 times, 1 month ago
Once, 2 months ago
53 more bugmates

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