This site requires JavaScript, please enable it in your browser!
Greenfoot back
RGW
RGW wrote ...

2012/5/15

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space

RGW RGW

2012/5/15

#
I am getting am getting a memory error message every time I load my project and try to edit it. I will allow me to compile it but not make any changes. The error I am receiving is: Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:58) at java.awt.image.ComponentSampleModel.createDataBuffer(ComponentSampleModel.java:397) at java.awt.image.Raster.createWritableRaster(Raster.java:938) at javax.imageio.ImageTypeSpecifier.createBufferedImage(ImageTypeSpecifier.java:1056) at javax.imageio.ImageReader.getDestination(ImageReader.java:2879) at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1263) at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1560) at javax.imageio.ImageIO.read(ImageIO.java:1422) at javax.imageio.ImageIO.read(ImageIO.java:1282) at greenfoot.gui.images.ImageLibList$ImageListEntry.loadPreview(ImageLibList.java:409) at greenfoot.gui.images.ImageLibList$ImageListEntry.<init>(ImageLibList.java:398) at greenfoot.gui.images.ImageLibList$ImageListEntry.<init>(ImageLibList.java:373) at greenfoot.gui.images.ImageLibList$ImageListEntry.<init>(ImageLibList.java:365) at greenfoot.gui.images.ImageLibList.setDirectory(ImageLibList.java:156) at greenfoot.gui.images.ImageLibList.<init>(ImageLibList.java:126) at greenfoot.gui.images.ImageLibFrame.buildUI(ImageLibFrame.java:193) at greenfoot.gui.images.ImageLibFrame.<init>(ImageLibFrame.java:158) at greenfoot.actions.NewSubclassAction.createImageClass(NewSubclassAction.java:91) at greenfoot.actions.NewSubclassAction.actionPerformed(NewSubclassAction.java:81) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242) at javax.swing.AbstractButton.doClick(AbstractButton.java:357) at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:809) at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:850) at java.awt.Component.processMouseEvent(Component.java:6288) at javax.swing.JComponent.processMouseEvent(JComponent.java:3267) at java.awt.Component.processEvent(Component.java:6053) at java.awt.Container.processEvent(Container.java:2041) at java.awt.Component.dispatchEventImpl(Component.java:4651) at java.awt.Container.dispatchEventImpl(Container.java:2099)
danpost danpost

2012/5/16

#
It appears you have at lot of, or very large image files that are hogging up memory. Remove a large one or two from the 'images' folder and try to load it then; you will still get an error, but it will probably just be one that state 'FileNotFoundException'; and you should then be able to edit it. Let us know if that worked.
You need to login to post a reply.