Import out of memory

hello



I had out of memory popup during import of a blender file

so i changed the jmonkeyplatform.conf like this :



default_options="–branding jmonkeyplatform -J-Xms1024m -J-Xmx1024m -J-XX:PermSize=256m -XX:MaxDirectMemorySize=1024m …



but i still get the message

Code:
java.lang.OutOfMemoryError
at sun.misc.Unsafe.allocateMemory(Native Method)
at java.nio.DirectByteBuffer.(DirectByteBuffer.java:127)
at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:306)
at com.jme3.util.BufferUtils.createByteBuffer(BufferUtils.java:909)
at com.jme3.scene.plugins.blender.textures.blending.TextureBlenderAWT.blend(TextureBlenderAWT.java:68)
at com.jme3.scene.plugins.blender.textures.CombinedTexture.blend(CombinedTexture.java:190)
at com.jme3.scene.plugins.blender.textures.CombinedTexture.flatten(CombinedTexture.java:120)
at com.jme3.scene.plugins.blender.materials.MaterialContext.applyMaterial(MaterialContext.java:212)
at com.jme3.scene.plugins.blender.meshes.MeshHelper.toMesh(MeshHelper.java:215)
at com.jme3.scene.plugins.blender.objects.ObjectHelper.toObject(ObjectHelper.java:157)
at com.jme3.scene.plugins.blender.AbstractBlenderLoader.toObject(AbstractBlenderLoader.java:132)
at com.jme3.scene.plugins.blender.BlenderLoader.toObject(BlenderLoader.java:70)
at com.jme3.scene.plugins.blender.BlenderModelLoader.load(BlenderModelLoader.java:63)
at com.jme3.scene.plugins.blender.BlenderModelLoader.load(BlenderModelLoader.java:49)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:282)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:410)
at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:90)
at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:53)
at com.jme3.gde.core.assets.AssetData.loadAsset(AssetData.java:84)
at com.jme3.gde.modelimporter.ModelImporterVisualPanel3.loadModel(ModelImporterVisualPanel3.java:90)
at com.jme3.gde.modelimporter.ModelImporterVisualPanel3.loadSettings(ModelImporterVisualPanel3.java:59)
at com.jme3.gde.modelimporter.ModelImporterWizardPanel3.readSettings(ModelImporterWizardPanel3.java:81)
at org.openide.WizardDescriptor.updateStateOpen(WizardDescriptor.java:910)
at org.openide.WizardDescriptor.updateState(WizardDescriptor.java:861)
at org.openide.WizardDescriptor.goToNextStep(WizardDescriptor.java:1072)
at org.openide.WizardDescriptor.access$1200(WizardDescriptor.java:137)
at org.openide.WizardDescriptor$Listener$1.run(WizardDescriptor.java:2052)
at org.openide.WizardDescriptor.lazyValidate(WizardDescriptor.java:1480)
at org.openide.WizardDescriptor.access$1300(WizardDescriptor.java:137)
at org.openide.WizardDescriptor$Listener.actionPerformed(WizardDescriptor.java:2071)
Caused: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.openide.util.WeakListenerImpl$ProxyListener.invoke(WeakListenerImpl.java:459)
Caused: java.lang.reflect.UndeclaredThrowableException
at $Proxy33.actionPerformed(Unknown Source)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2713)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:680)
at java.awt.EventQueue$4.run(EventQueue.java:678)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:121)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
at java.awt.Dialog.show(Dialog.java:1072)
at org.netbeans.core.windows.services.NbPresenter.superShow(NbPresenter.java:1038)
at org.netbeans.core.windows.services.NbPresenter.doShow(NbPresenter.java:1072)
at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:1060)
at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:126)
at org.openide.util.Mutex.doEventAccess(Mutex.java:1361)
at org.openide.util.Mutex.readAccess(Mutex.java:271)
at org.netbeans.core.windows.services.NbPresenter.show(NbPresenter.java:1045)
at java.awt.Component.show(Component.java:1651)
at java.awt.Component.setVisible(Component.java:1603)
at java.awt.Window.setVisible(Window.java:1013)
at java.awt.Dialog.setVisible(Dialog.java:1003)
at com.jme3.gde.modelimporter.ImportModel.actionPerformed(ImportModel.java:52)
at org.openide.awt.InjectorExactlyOne.actionPerformed(InjectorExactlyOne.java:78)
at org.openide.awt.ContextAction$Performer.actionPerformed(ContextAction.java:226)
at org.openide.awt.ContextManager.actionPerformed(ContextManager.java:250)
at org.openide.awt.ContextAction.actionPerformed(ContextAction.java:109)
at org.openide.util.actions.ActionInvoker$1.run(ActionInvoker.java:93)
at org.openide.util.actions.ActionInvoker.doPerformAction(ActionInvoker.java:116)
at org.openide.util.actions.ActionInvoker.invokeAction(ActionInvoker.java:99)
at org.openide.awt.GeneralAction$DelegateAction.actionPerformed(GeneralAction.java:219)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:289)
at java.awt.Component.processMouseEvent(Component.java:6505)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3321)
at java.awt.Component.processEvent(Component.java:6270)
at java.awt.Container.processEvent(Container.java:2229)
at java.awt.Component.dispatchEventImpl(Component.java:4861)
at java.awt.Container.dispatchEventImpl(Container.java:2287)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
at java.awt.Container.dispatchEventImpl(Container.java:2273)
at java.awt.Window.dispatchEventImpl(Window.java:2713)
at java.awt.Component.dispatchEvent(Component.java:4687)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:707)
at java.awt.EventQueue.access$000(EventQueue.java:101)
at java.awt.EventQueue$3.run(EventQueue.java:666)
at java.awt.EventQueue$3.run(EventQueue.java:664)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
at java.awt.EventQueue$4.run(EventQueue.java:680)
at java.awt.EventQueue$4.run(EventQueue.java:678)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:677)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:148)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:128)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:117)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:113)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Code:

How big is that blend file? Filesize, vertices, textures, etc



Keep increasing MaxDirectMemorySize until that doesn’t happen anymore :wink:

@sbook said:
How big is that blend file? Filesize, vertices, textures, etc

Keep increasing MaxDirectMemorySize until that doesn't happen anymore ;)


104 mb
max tex size 4096x4096
latest added texture : 34mb

104mb?



Yeah, keep upping the memory allocation :wink:

@sbook said:
104mb?

Yeah, keep upping the memory allocation ;)


yep a big scene, all layers are full

You might consider breaking it into smaller chunks or exporting different blends based on elements of the scene.

@sbook said:
You might consider breaking it into smaller chunks or exporting different blends based on elements of the scene.


that's why i used layers but i'll do that anyway
strange that as i click on next button, it show up the scene in the dialog, but as i click import, same error
anyways i'll cut it in diff parts

So ive bene having the same issue and the max I can up my memory is to 1500 and I am still getting the out of memory error. I hve a loooooooooooooot of objects… is there a limit on how many I could load??

Currently the blender importer loves to allocate mountains of memory … Your best bet is to just split things up. Also I recommend batching your objects in Blender prior to importing them into jME3. 1500 will be quite slow.

@Momoko_Fan said:
Currently the blender importer loves to allocate mountains of memory .. Your best bet is to just split things up. Also I recommend batching your objects in Blender prior to importing them into jME3. 1500 will be quite slow.

Batch ? You mean to pack the file?

Nope he means joining the object into one (select all objects and hit ctrl + J)

Is JME still using the same blender importer as when this thread was started? I see now it is using the blender .exe, which works for me on small models, although on larger more complex models it is running out of RAM for me :frowning:
I have a base character that I want to import (http://arteria3d.com/collections/animated-characters/products/medieval-base-male) but it just hangs when i try to import.dae, runs out of RAM if I use a .blend (which I made first by importing it to Blender) and silently fails when I try importing it as an ogre mesh (output from fragmotion).

Is there some way to increase the log verbosity of the importing process so I can see more clearly where its failing in each case?