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

2014/12/14

Increase heap space

Hey guys, I wanted to make a project which includes a video. As it isn't possible to just say "play video" I decided to write an algorithm which is loading every frame of the video and will change the picture every frame. As it isn't possible to load 60 different (800x600px) images in a second I decided to load all the images in a list before the world loads. But everytime a Video is above 200 frames it gives me the error java.lang.OutOfMemoryError: Java heap space Evenwhile all images together are just 6 fucking megabyte big. So is there a way to increase the heap space? (The script which loads the images works fine)
danpost danpost

2014/12/14

#
You could size down the pictures and only show every other picture. This would reduce the load on the heap space dramatically. At a size of (400x300px) showing only half the pictures, you will reduce the load by over 87 percent.
You need to login to post a reply.