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

2013/8/19

Increase heapsize on website

SPower SPower

2013/8/19

#
Hi all, While developing my new game I often get an exception telling me there's not enough space left in the heap. Now you don't have to explain me what the heap is, but how can I increase it's size? This also has to work on the greenfoot website or otherwise the game will often crash on the site. Thanks already!
Gevater_Tod4711 Gevater_Tod4711

2013/8/19

#
I also often get this errors (even with 16GB RAM). I think the only way to make your programm take more heap is to intervene in the greenfoot source code. But this will probably cause that your game doesn't work on other computers or other greenfoot programms. But on the webside I think I never got any OutOfMemoryErrors. So that will not be a problem I think.
SPower SPower

2013/8/19

#
Well, too bad you can't change it easily. But can anyone confirm that on the website you don't get an OutOfMemoryErrors? (I want to be really sure, not that I don't trust Gevater_Tod :) )
davmac davmac

2013/8/20

#
The amount of memory allocated for the heap depends on how much physical RAM you have in your system, so it's quite possible that for some scenarios some people get a heap overflow (OutOfMemoryError) while others don't. As for increasing the heap size on the website - I'm afraid you can't. If you put an applet on your own website, you can control the VM arguments including heap size as per this web page. The Greenfoot website doesn't provide any way to set those parameters; you should try to make sure your scenario doesn't consume too much heap.
SPower SPower

2013/8/20

#
Ok, thanks davmac. I already scaled a rather large image down so it consumes a lot less memory. (and considering the fact I have 6GB RAM, it really was a large image for a greenfoot scenario)
You need to login to post a reply.