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 Stack Overflow by Karl Morrison
, 1 year ago
via GitHub by Timoux
, 1 year ago
via Google Groups by deepak singh, 1 year ago
Java heap space* *java.lang.OutOfMemoryError: Java heap space*
via Google Groups by ctesniere via StackOverflow, 3 months ago
via Google Groups by advocate via StackOverflow, 3 months ago
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3236)
at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:118)
at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:135)
at sun.font.XRGlyphCacheEntry.writePixelData(XRGlyphCacheEntry.java:154)
at sun.font.XRGlyphCache.generateGlyphImageStream(XRGlyphCache.java:217)
at sun.font.XRGlyphCache.uploadGlyphs(XRGlyphCache.java:164)
at sun.font.XRGlyphCache.cacheGlyphs(XRGlyphCache.java:134)
at sun.font.XRTextRenderer.drawGlyphList(XRTextRenderer.java:81)
at sun.java2d.pipe.GlyphListPipe.drawString(GlyphListPipe.java:72)
at sun.java2d.SunGraphics2D.drawString(SunGraphics2D.java:2928)
at sun.swing.SwingUtilities2.drawString(SwingUtilities2.java:593)
at sun.swing.SwingUtilities2.drawStringUnderlineCharAt(SwingUtilities2.java:612)
at com.intellij.ui.plaf.beg.IdeaMenuUI.paint(IdeaMenuUI.java:169)
at javax.swing.JComponent.paintComponent(JComponent.java:780)
at javax.swing.JComponent.paint(JComponent.java:1056)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paint(JComponent.java:1065)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:586)
at javax.swing.JComponent.paintChildren(JComponent.java:889)
at javax.swing.JComponent.paintToOffscreen(JComponent.java:5217)
at javax.swing.RepaintManager$PaintManager.paintDoubleBuffered(RepaintManager.java:1579)
at javax.swing.RepaintManager$PaintManager.paint(RepaintManager.java:1502)
at javax.swing.RepaintManager.paint(RepaintManager.java:1272)
at javax.swing.JComponent.paint(JComponent.java:1042)
at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:39)

Users with the same issue

2 times, 4 days 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.