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

2011/12/21

Error that isn't my fault?

kiarocks kiarocks

2011/12/21

#
I got this error when trying to compile. It doesn't include any of my code so this could be greenfoot.
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
	at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:41)
	at java.awt.image.Raster.createPackedRaster(Raster.java:458)
	at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015)
	at java.awt.image.BufferedImage.<init>(BufferedImage.java:343)
	at apple.awt.CGraphicsConfig.createCompatibleImage(CGraphicsConfig.java:133)
	at greenfoot.util.GraphicsUtilities.toCompatibleTranslucentImage(GraphicsUtilities.java:285)
	at greenfoot.util.GraphicsUtilities.loadCompatibleTranslucentImage(GraphicsUtilities.java:227)
	at greenfoot.GreenfootImage.loadURL(GreenfootImage.java:260)
	at greenfoot.GreenfootImage.loadFile(GreenfootImage.java:287)
	at greenfoot.GreenfootImage.<init>(GreenfootImage.java:109)
	at greenfoot.util.GreenfootUtil.getGreenfootImage(GreenfootUtil.java:794)
	at greenfoot.core.ProjectProperties.getImage(ProjectProperties.java:269)
	at greenfoot.gui.classbrowser.role.ImageClassRole.getClassThatHasImage(ImageClassRole.java:98)
	at greenfoot.gui.classbrowser.role.ImageClassRole.getGreenfootImage(ImageClassRole.java:109)
	at greenfoot.gui.classbrowser.role.ImageClassRole.getImage(ImageClassRole.java:80)
	at greenfoot.gui.classbrowser.role.ImageClassRole.changeImage(ImageClassRole.java:156)
	at greenfoot.gui.classbrowser.role.ImageClassRole.buildUI(ImageClassRole.java:63)
	at greenfoot.gui.classbrowser.ClassView.update(ClassView.java:188)
	at greenfoot.gui.classbrowser.ClassView.updateView(ClassView.java:412)
	at greenfoot.core.GClass$2.run(GClass.java:600)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677)
	at java.awt.EventQueue.access$000(EventQueue.java:85)
	at java.awt.EventQueue$1.run(EventQueue.java:638)
	at java.awt.EventQueue$1.run(EventQueue.java:636)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:647)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
	at java.awt.image.DataBufferInt.<init>(DataBufferInt.java:41)
	at java.awt.image.Raster.createPackedRaster(Raster.java:458)
	at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1015)
	at java.awt.image.BufferedImage.<init>(BufferedImage.java:343)
	at apple.awt.CGraphicsConfig.createCompatibleImage(CGraphicsConfig.java:133)
	at greenfoot.util.GraphicsUtilities.createCompatibleTranslucentImage(GraphicsUtilities.java:178)
	at greenfoot.GreenfootImage.<init>(GreenfootImage.java:141)
	at greenfoot.GreenfootImage.<init>(GreenfootImage.java:117)
	at greenfoot.util.GreenfootUtil.getGreenfootImage(GreenfootUtil.java:794)
	at greenfoot.core.ProjectProperties.getImage(ProjectProperties.java:269)
	at greenfoot.gui.classbrowser.role.ImageClassRole.getClassThatHasImage(ImageClassRole.java:98)
	at greenfoot.gui.classbrowser.role.ImageClassRole.getGreenfootImage(ImageClassRole.java:109)
	at greenfoot.gui.classbrowser.role.ImageClassRole.getImage(ImageClassRole.java:80)
	at greenfoot.gui.classbrowser.role.ImageClassRole.changeImage(ImageClassRole.java:156)
	at greenfoot.gui.classbrowser.role.ImageClassRole.buildUI(ImageClassRole.java:63)
	at greenfoot.gui.classbrowser.ClassView.update(ClassView.java:188)
	at greenfoot.gui.classbrowser.ClassView.updateView(ClassView.java:412)
	at greenfoot.core.GClass$2.run(GClass.java:600)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677)
	at java.awt.EventQueue.access$000(EventQueue.java:85)
	at java.awt.EventQueue$1.run(EventQueue.java:638)
	at java.awt.EventQueue$1.run(EventQueue.java:636)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:647)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
kiarocks kiarocks

2011/12/21

#
Restarted Greenfoot and it went away. Any idea what happened?
Builderboy2005 Builderboy2005

2011/12/21

#
You ran out of memory. It's not a serious error, I get it periodically while working on Nightmare, and indeed the solution is to just restart Greenfoot so it can get a fresh start. It generally happens with large scenarios that take up a lot of memory and use large images. It might also be possible there is some sort of memory leak somewhere that is preventing cleanup of certain parts of memory, but you would have to ask some of the developers about that.
kiarocks kiarocks

2011/12/21

#
Weird, i changed one line of code and this happened, so it wasn't the images.
Builderboy2005 Builderboy2005

2011/12/21

#
The error message references GreenfootImage, so it definitely is Images. Note that the simple act of recompiling makes Greenfoot take more and more memory, regardless if you changed anything. When I recompile Nightmare 32 times, even if I am making changes that have nothing to do with GreenfootImages, they will still continue to take memory and eventually error. The lines of code I modify don't cause the error, just the recompiling.
kiarocks kiarocks

2011/12/22

#
Ok, hope it wont happen again.
Builderboy2005 Builderboy2005

2011/12/22

#
It probably will if you keep recompiling your projects, but it's not a fatal error so simply restarting Greenfoot will fix everything.
DonaldDuck DonaldDuck

2011/12/29

#
This may be helpful
You need to login to post a reply.