My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 31: Java heap space error with redraw method
2 people starred this issue and may be notified of changes. Back to list
 
Project Member Reported by alexandr...@gmail.com, Apr 6, 2010
What steps will reproduce the problem?
1. Play many turns with multiple players
2.
3.

What is the expected output? What do you see instead?
Java heap space error

Exception in thread "GameClient:Hatice" 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:324)
	at apple.awt.CGraphicsConfig.createCompatibleImage(CGraphicsConfig.java:133)
	at org.minueto.image.ImageTools.createAcceleratedImage(ImageTools.java:44)
	at org.minueto.image.MinuetoImage.accelerateBuffer(MinuetoImage.java:515)
	at org.minueto.image.MinuetoImage.setUpImage(MinuetoImage.java:122)
	at org.minueto.image.MinuetoImage.<init>(MinuetoImage.java:83)
	at ui.MainUI.drawMap(MainUI.java:780)
	at ui.MainUI.redrawAfterMove(MainUI.java:483)
	at game.Move.execute(Move.java:88)
	at game.Turn.executeNetworkMove(Turn.java:109)
	at network.GameClient.run(GameClient.java:75)
	at java.lang.Thread.run(Thread.java:637)

Apr 6, 2010
Project Member #1 alexandr...@gmail.com
I'm not familiar with the Minueto API but is there any chance we have memory leaks due to creating new Minueto 
images at each redraw. Could there be lost references to these drawing artifacts that persist and prevent the java 
garbage collector from freeing up the memory?
Cc: jgl2832 fwwarr
Apr 6, 2010
Project Member #2 fww...@gmail.com
I've just tested this out. I played a game with 3 players and created a about a dozen 
units for each. The applications each used up to 300 MB but I had no heap space errors. 
I then made the units kill each other until only a few remained for one player and the 
memory size went back down a bit, suggesting that the memory gets freed at least 
partially. I think for the acceptance test, they won't have time to create tons of 
units so if we ensure the the java heap space is large enough on all the computers we 
will be using we should be ok. I would suggest bumping it up to 1GB or so if possible.

Powered by Google Project Hosting