My Scene was running perfectly fine until I added some trees in sceneComposer. The application complains about java out of memory error. I have added -Xmx2g option but it didn’t help. Now the scene doesn’t even load in sceneComposer. Here is the stack trace.
java.lang.OutOfMemoryError: Java heap space
at com.jme3.export.binary.BinaryImporter.readString(BinaryImporter.java:292)
at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:181)
at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:125)
at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:109)
at com.jme3.scene.AssetLinkNode.read(AssetLinkNode.java:162)
at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:344)
at com.jme3.export.binary.BinaryInputCapsule.resolveIDs(BinaryInputCapsule.java:483)
at com.jme3.export.binary.BinaryInputCapsule.readSavableArray(BinaryInputCapsule.java:471)
at com.jme3.export.binary.BinaryInputCapsule.readSavableArrayList(BinaryInputCapsule.java:587)
at com.jme3.scene.Node.read(Node.java:599)
at com.jme3.export.binary.BinaryImporter.readObject(BinaryImporter.java:344)
at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:242)
at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:125)
at com.jme3.export.binary.BinaryImporter.load(BinaryImporter.java:109)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:288)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:374)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:378)
at mygame.Main.simpleInitApp(Main.java:28)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:226)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:207)
at java.lang.Thread.run(Thread.java:744)