Loading FBX crashes game

Hello,

I have got a bird model, with a three-frame animation, which I am attempting to load into the game, using

Spatial bird = Main.manageAsset.loadModel("Models/Bird_with_animation.fbx");

However, it keeps crashing the game with a “out of memory java heap space” error, even though less than 1GB of RAM is used, and my system has over 8GB of RAM remaining to be used.

Removing the loading of the FBX model solves the crash, but I would like to load the FBX without the crash.

What is wrong here?

Thanks,
Joe

Probably your JVM memory settings.

Which memory settings? The game easily uses up 4GB once fully loaded, but it is only using 1GB by the time it crashes with the FBX model.

Which memory settings am I adjusting, and where?

When you say crash, what errors or messages are given at the console? There is crash and there is Crash.

Theres a difference between java heap which is used while loading models and direct memory which is used for textures and models when they are loaded (and uploaded to the GPU).

See here:
http://www.gemstone.com/docs/html/gemfire/6.0.0/SystemAdministratorsGuide/monitoring_tuning.8.4.html

You can set them in the project preferences.

And yes, posting “I got an error” without the actual error output is kind of useless and only allows guessing what your problem might be.

1 Like

Blender won’t import it either. Perhaps the model is corrupt.

Also, here is the error:

java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:152)
at com.jme3.scene.plugins.fbx.file.FbxElement.<init>(FbxElement.java:61)
at com.jme3.scene.plugins.fbx.file.FbxReader.readFBXElement(FbxReader.java:86)
at com.jme3.scene.plugins.fbx.file.FbxReader.readFBXElement(FbxReader.java:96)
at com.jme3.scene.plugins.fbx.file.FbxReader.readFBX(FbxReader.java:71)
at com.jme3.scene.plugins.fbx.SceneLoader.loadScene(SceneLoader.java:168)
at com.jme3.scene.plugins.fbx.SceneLoader.load(SceneLoader.java:149)
at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:262)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:376)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:419)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:423)
at mygame.Bird.<init>(Bird.java:25)
at mygame.Chunk.<init>(Chunk.java:87)
at mygame.Chunk.loadChunk(Chunk.java:133)
at mygame.Main.simpleUpdate(Main.java:638)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:246)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:152)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:192)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:233)
at java.lang.Thread.run(Thread.java:745)

When exporting to FBX are you selecting type = Binary
also did you test with Dae-FBX .
and you may better use last version of blender.

I don’t know, I am not the modeller. What does that mean?

As I see (in your previous post) you are using some product of auto desk for modeling.
I have some little experience with 3ds max .
and while exporting to FBX in 3ds max there are lots of options you can change .
one of them is type of fbx. I also do not know what are differences just know that blender can import FBX with binary format.

The other very important thing is material type.
in 3ds max you can use Standard Mat or Vray Mat or …
if it is non Standard then blender simply can not import that model.(At least I am sure about Vray Mat)

Edit : also there is this good tutorial . hope it helps :

@Ali_RS As I said, I’m not the modeller, but I’ll pass the information on, as this definitely seems like a model format issue now.

You can have a look at the model at http://www.filedropper.com/birdwithanimation, if you’d like.

It’s a corrupt file. Even Blender cannot open it.