Java Heap space (the forester)

Hello everyone!

I’m trying to use the forester for importing trees and grass in my game.

The grass works perfectly well, but when I’m importing trees, I get an error :

Grave: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.OutOfMemoryError: Java heap space
at com.jme3.export.binary.BinaryImporter.readString(
at com.jme3.export.binary.BinaryImporter.load(
at com.jme3.export.binary.BinaryImporter.load(
at com.jme3.export.binary.BinaryImporter.load(
at com.jme3.asset.DesktopAssetManager.loadAsset(
at com.jme3.asset.DesktopAssetManager.loadModel(
at com.jme3.asset.DesktopAssetManager.loadModel(
at SimpleTreeTest.setupForester(
at SimpleTreeTest.simpleInitApp(
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(
at Source)

So I read some topics relating this and I tried to change the default heap space size in my game by adding these options:


But it doesn't fix it :s

Thank you.

is it the demo throwing these exceptions?

Yep. That’s really strange. I tried this on eclipse and with the sdk but nothing change.

EDIt: Ho and I forgot something, I can’t import the tree in the default test-data. So I downloaded the last one in the SVN. And with this one, the heap space issue appeared.

EDIT2: I cleaned all the project and resintalled the forester and tried again and it works. Can’t figure out why, but it works fine.

Thank you !

Note jme uses a lot of direct memory, thats not part of the heap.


You’re welcome.