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


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



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>( at java.awt.image.ComponentSampleModel.createDataBuffer( at java.awt.image.Raster.createWritableRaster( at javax.imageio.ImageTypeSpecifier.createBufferedImage( at javax.imageio.ImageReader.getDestination( at com.sun.imageio.plugins.png.PNGImageReader.readImage( at at at at greenfoot.gui.images.ImageLibList$ImageListEntry.loadPreview( at greenfoot.gui.images.ImageLibList$ImageListEntry.<init>( at greenfoot.gui.images.ImageLibList$ImageListEntry.<init>( at greenfoot.gui.images.ImageLibList$ImageListEntry.<init>( at greenfoot.gui.images.ImageLibList.setDirectory( at greenfoot.gui.images.ImageLibList.<init>( at greenfoot.gui.images.ImageLibFrame.buildUI( at greenfoot.gui.images.ImageLibFrame.<init>( at greenfoot.actions.NewSubclassAction.createImageClass( at greenfoot.actions.NewSubclassAction.actionPerformed( at javax.swing.AbstractButton.fireActionPerformed( at javax.swing.AbstractButton$Handler.actionPerformed( at javax.swing.DefaultButtonModel.fireActionPerformed( at javax.swing.DefaultButtonModel.setPressed( at javax.swing.AbstractButton.doClick( at javax.swing.plaf.basic.BasicMenuItemUI.doClick( at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased( at java.awt.Component.processMouseEvent( at javax.swing.JComponent.processMouseEvent( at java.awt.Component.processEvent( at java.awt.Container.processEvent( at java.awt.Component.dispatchEventImpl( at java.awt.Container.dispatchEventImpl(
danpost danpost


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.