java.lang.OutOfMemoryError: Java heap space

Sonatype JIRA | Barrie Treloar | 4 years ago
  1. 0

    When mirroring http://download.eclipse.org/releases/indigo/ and then accessing <mirror>/content.xml cause OutOfMemoryError. Probably because that file is so damn big that java.util.Arrays.copyOf is not a great choice all the way down that stack. A side effect of this problem is that an already cached copy has been deleted and so the mirror is now wedged until a reboot, whereas copying the file to a side location would leave me with an inconsistent but perhaps usable mirror. {noformat} 2012-06-19 14:41:39 ERROR [r-14481-exec-28] - org.sonatype.nexus.rest.NexusApplication - Unhandled exception or error intercepted java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:2786) ~[na:1.6.0_27] at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94) ~[na:1.6.0_27] at sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202) ~[na:1.6.0_27] at sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263) ~[na:1.6.0_27] at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106) ~[na:1.6.0_27] at sun.nio.cs.StreamEncoder.write(StreamEncoder.java:116) ~[na:1.6.0_27] at java.io.OutputStreamWriter.write(OutputStreamWriter.java:203) ~[na:1.6.0_27] at java.io.Writer.write(Writer.java:140) ~[na:1.6.0_27] at org.codehaus.plexus.util.xml.pull.MXSerializer.writeAttributeValue(MXSerializer.java:880) ~[plexus-utils-2.1.jar:na] at org.codehaus.plexus.util.xml.pull.MXSerializer.attribute(MXSerializer.java:663) ~[plexus-utils-2.1.jar:na] at org.codehaus.plexus.util.xml.SerializerXMLWriter.addAttribute(SerializerXMLWriter.java:67) ~[plexus-utils-2.1.jar:na] at org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Xpp3DomWriter.java:50) ~[plexus-utils-2.1.jar:na] at org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Xpp3DomWriter.java:55) ~[plexus-utils-2.1.jar:na] at org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Xpp3DomWriter.java:55) ~[plexus-utils-2.1.jar:na] at org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Xpp3DomWriter.java:55) ~[plexus-utils-2.1.jar:na] at org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Xpp3DomWriter.java:55) ~[plexus-utils-2.1.jar:na] at org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Xpp3DomWriter.java:39) ~[plexus-utils-2.1.jar:na] at org.codehaus.plexus.util.xml.Xpp3Dom.writeToSerializer(Xpp3Dom.java:291) ~[plexus-utils-2.1.jar:na] at org.sonatype.nexus.plugins.p2.repository.metadata.AbstractP2MetadataSource.createMetadataItem(AbstractP2MetadataSource.java:105) ~[na:na] at org.sonatype.nexus.plugins.p2.repository.metadata.AbstractP2MetadataSource.createMetadataItem(AbstractP2MetadataSource.java:80) ~[na:na] at org.sonatype.nexus.plugins.p2.repository.metadata.AbstractP2MetadataSource.doRetrieveContentItem(AbstractP2MetadataSource.java:492) ~[na:na] at org.sonatype.nexus.plugins.p2.repository.metadata.AbstractP2MetadataSource.doRetrieveItem(AbstractP2MetadataSource.java:214) ~[na:na] at org.sonatype.nexus.plugins.p2.repository.proxy.P2ProxyRepositoryImpl.doRetrieveItem(P2ProxyRepositoryImpl.java:444) ~[na:na] at org.sonatype.nexus.proxy.repository.AbstractRepository.retrieveItem(AbstractRepository.java:769) ~[nexus-proxy-2.0.3.jar:na] at org.sonatype.nexus.plugins.p2.repository.proxy.P2ProxyRepositoryImpl.retrieveItem(P2ProxyRepositoryImpl.java:417) ~[na:na] at org.sonatype.nexus.proxy.repository.AbstractRepository.retrieveItem(AbstractRepository.java:584) ~[nexus-proxy-2.0.3.jar:na] at org.sonatype.nexus.proxy.router.DefaultRepositoryRouter.retrieveItem(DefaultRepositoryRouter.java:183) ~[nexus-proxy-2.0.3.jar:na] at org.sonatype.nexus.rest.AbstractResourceStoreContentPlexusResource.get(AbstractResourceStoreContentPlexusResource.java:139) ~[nexus-rest-api-2.0.3.jar:na] at org.sonatype.plexus.rest.resource.RestletResource.represent(RestletResource.java:249) ~[plexus-restlet-bridge-1.18.jar:na] at org.sonatype.nexus.rest.NexusRestletResource.represent(NexusRestletResource.java:44) ~[nexus-rest-api-2.0.3.jar:na] at org.restlet.resource.Resource.getRepresentation(Resource.java:302) ~[org.restlet-1.1.6-SONATYPE-5348-V4.jar:na] at org.restlet.resource.Resource.handleGet(Resource.java:464) ~[org.restlet-1.1.6-SONATYPE-5348-V4.jar:na] 2012-06-19 14:51:04 ERROR [r-14481-exec-28] - org.sonatype.nexus.rest.NexusApplication - Unhandled exception or error intercepted {noformat}

    Sonatype JIRA | 4 years ago | Barrie Treloar
    java.lang.OutOfMemoryError: Java heap space
  2. 0

    Running `brjs test` often results in OutOfMemoryError

    GitHub | 3 years ago | leggetter
    java.lang.OutOfMemoryError: Java heap space
  3. 0

    java.lang.OutOfMemoryError: Java heap space in jasper report

    Stack Overflow | 7 years ago
    java.lang.OutOfMemoryError: Java heap space
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.OutOfMemoryError

      Java heap space

      at java.util.Arrays.copyOf()
    2. Java RT
      Writer.write
      1. java.util.Arrays.copyOf(Arrays.java:2786)[na:1.6.0_27]
      2. java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)[na:1.6.0_27]
      3. sun.nio.cs.StreamEncoder.writeBytes(StreamEncoder.java:202)[na:1.6.0_27]
      4. sun.nio.cs.StreamEncoder.implWrite(StreamEncoder.java:263)[na:1.6.0_27]
      5. sun.nio.cs.StreamEncoder.write(StreamEncoder.java:106)[na:1.6.0_27]
      6. sun.nio.cs.StreamEncoder.write(StreamEncoder.java:116)[na:1.6.0_27]
      7. java.io.OutputStreamWriter.write(OutputStreamWriter.java:203)[na:1.6.0_27]
      8. java.io.Writer.write(Writer.java:140)[na:1.6.0_27]
      8 frames
    3. Plexus Common Utilities
      Xpp3Dom.writeToSerializer
      1. org.codehaus.plexus.util.xml.pull.MXSerializer.writeAttributeValue(MXSerializer.java:880)[plexus-utils-2.1.jar:na]
      2. org.codehaus.plexus.util.xml.pull.MXSerializer.attribute(MXSerializer.java:663)[plexus-utils-2.1.jar:na]
      3. org.codehaus.plexus.util.xml.SerializerXMLWriter.addAttribute(SerializerXMLWriter.java:67)[plexus-utils-2.1.jar:na]
      4. org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Xpp3DomWriter.java:50)[plexus-utils-2.1.jar:na]
      5. org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Xpp3DomWriter.java:55)[plexus-utils-2.1.jar:na]
      6. org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Xpp3DomWriter.java:55)[plexus-utils-2.1.jar:na]
      7. org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Xpp3DomWriter.java:55)[plexus-utils-2.1.jar:na]
      8. org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Xpp3DomWriter.java:55)[plexus-utils-2.1.jar:na]
      9. org.codehaus.plexus.util.xml.Xpp3DomWriter.write(Xpp3DomWriter.java:39)[plexus-utils-2.1.jar:na]
      10. org.codehaus.plexus.util.xml.Xpp3Dom.writeToSerializer(Xpp3Dom.java:291)[plexus-utils-2.1.jar:na]
      10 frames
    4. org.sonatype.nexus
      P2ProxyRepositoryImpl.doRetrieveItem
      1. org.sonatype.nexus.plugins.p2.repository.metadata.AbstractP2MetadataSource.createMetadataItem(AbstractP2MetadataSource.java:105)[na:na]
      2. org.sonatype.nexus.plugins.p2.repository.metadata.AbstractP2MetadataSource.createMetadataItem(AbstractP2MetadataSource.java:80)[na:na]
      3. org.sonatype.nexus.plugins.p2.repository.metadata.AbstractP2MetadataSource.doRetrieveContentItem(AbstractP2MetadataSource.java:492)[na:na]
      4. org.sonatype.nexus.plugins.p2.repository.metadata.AbstractP2MetadataSource.doRetrieveItem(AbstractP2MetadataSource.java:214)[na:na]
      5. org.sonatype.nexus.plugins.p2.repository.proxy.P2ProxyRepositoryImpl.doRetrieveItem(P2ProxyRepositoryImpl.java:444)[na:na]
      5 frames
    5. ${project.groupId}:${project.artifactId}
      AbstractRepository.retrieveItem
      1. org.sonatype.nexus.proxy.repository.AbstractRepository.retrieveItem(AbstractRepository.java:769)[nexus-proxy-2.0.3.jar:na]
      1 frame
    6. org.sonatype.nexus
      P2ProxyRepositoryImpl.retrieveItem
      1. org.sonatype.nexus.plugins.p2.repository.proxy.P2ProxyRepositoryImpl.retrieveItem(P2ProxyRepositoryImpl.java:417)[na:na]
      1 frame
    7. ${project.groupId}:${project.artifactId}
      DefaultRepositoryRouter.retrieveItem
      1. org.sonatype.nexus.proxy.repository.AbstractRepository.retrieveItem(AbstractRepository.java:584)[nexus-proxy-2.0.3.jar:na]
      2. org.sonatype.nexus.proxy.router.DefaultRepositoryRouter.retrieveItem(DefaultRepositoryRouter.java:183)[nexus-proxy-2.0.3.jar:na]
      2 frames
    8. Nexus Core
      AbstractResourceStoreContentPlexusResource.get
      1. org.sonatype.nexus.rest.AbstractResourceStoreContentPlexusResource.get(AbstractResourceStoreContentPlexusResource.java:139)[nexus-rest-api-2.0.3.jar:na]
      1 frame
    9. ${project.groupId}:${project.artifactId}
      RestletResource.represent
      1. org.sonatype.plexus.rest.resource.RestletResource.represent(RestletResource.java:249)[plexus-restlet-bridge-1.18.jar:na]
      1 frame
    10. Nexus Core
      NexusRestletResource.represent
      1. org.sonatype.nexus.rest.NexusRestletResource.represent(NexusRestletResource.java:44)[nexus-rest-api-2.0.3.jar:na]
      1 frame
    11. org.restlet.resource
      Resource.handleGet
      1. org.restlet.resource.Resource.getRepresentation(Resource.java:302)[org.restlet-1.1.6-SONATYPE-5348-V4.jar:na]
      2. org.restlet.resource.Resource.handleGet(Resource.java:464)[org.restlet-1.1.6-SONATYPE-5348-V4.jar:na]
      2 frames