Application crashes in SDK but not out of SDK

So i’ve been doing some work on terrain in jME:



http://hub.jmonkeyengine.org/groups/contribution-depot-jme3/forum/topic/projective-texture-mapping?topic_page=4&num=15



This was running fine from inside the SDK (launching the app with the play button). The SDK was beta 3 IIRC, and I had all the plugins etc updated and set to use nightlies (but it worked before I did that too).



I recently swapped my machine, reinstalled jME SDK (RC2 now) and it doesn’t work. I can build the project and start the app with the generated .exe fine, but if I try and run within the SDK I get:



SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]

java.lang.OutOfMemoryError: Direct buffer memory

at java.nio.Bits.reserveMemory(Bits.java:658)

at java.nio.DirectByteBuffer.(DirectByteBuffer.java:123)

at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:306)

at com.jme3.util.BufferUtils.createFloatBuffer(BufferUtils.java:831)

at com.jme3.terrain.geomipmap.LODGeomap.createMesh(LODGeomap.java:88)

at com.jme3.terrain.geomipmap.LODGeomap.createMesh(LODGeomap.java:80)

at com.jme3.terrain.geomipmap.TerrainPatch.(TerrainPatch.java:183)

at com.jme3.terrain.geomipmap.TerrainQuad.createQuadPatch(TerrainQuad.java:802)

at com.jme3.terrain.geomipmap.TerrainQuad.split(TerrainQuad.java:581)

at com.jme3.terrain.geomipmap.TerrainQuad.(TerrainQuad.java:237)

at com.jme3.terrain.geomipmap.TerrainQuad.createQuad(TerrainQuad.java:625)

at com.jme3.terrain.geomipmap.TerrainQuad.split(TerrainQuad.java:583)

at com.jme3.terrain.geomipmap.TerrainQuad.(TerrainQuad.java:237)

at com.jme3.terrain.geomipmap.TerrainQuad.createQuad(TerrainQuad.java:645)

at com.jme3.terrain.geomipmap.TerrainQuad.split(TerrainQuad.java:583)

at com.jme3.terrain.geomipmap.TerrainQuad.(TerrainQuad.java:237)

at com.jme3.terrain.geomipmap.TerrainQuad.createQuad(TerrainQuad.java:665)

at com.jme3.terrain.geomipmap.TerrainQuad.split(TerrainQuad.java:583)

at com.jme3.terrain.geomipmap.TerrainQuad.(TerrainQuad.java:237)

at com.jme3.terrain.geomipmap.TerrainQuad.createQuad(TerrainQuad.java:685)

at com.jme3.terrain.geomipmap.TerrainQuad.split(TerrainQuad.java:583)

at com.jme3.terrain.geomipmap.TerrainQuad.(TerrainQuad.java:237)

at com.jme3.terrain.geomipmap.TerrainQuad.(TerrainQuad.java:190)

at com.jme3.terrain.geomipmap.TerrainQuad.(TerrainQuad.java:156)

at TerrainTest.Main.setupTestTerrain(Main.java:235)

at TerrainTest.Main.simpleInitApp(Main.java:98)

at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:225)

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:722)



Any clues as to what might be different?

Not really, except actual memory limits of the machine. The applications are run in their own JVM. The SDK uses a bit too much direct memory atm though due to how the texture browser works.

Both machines are 4Gb ram, win7 64bit. There’s actually more memory on the new machine, as it has a dedicated graphics card rather than intel onboard nonsense.



I can have the SDK running and start the app by running the .exe, I just get that error if I hit the green arrow “play” button in the sdk. The .exe is using about 800Mb, the sdk about 400. It’s really odd that it was working fine, and now isn’t. I’ll see if I can download an old SDK version to see if that sorts it.

Ok, I’ve tracked the problem down:



For some reason in the new SDK it was using the 32bit JDK as the default platform, adding the 64bit one in and changing to use that - the project launches fine.



Currently trying to work out how I change it to always use the 64bit one…



EDIT: ok, so setting



jdkhome=“C:Program FilesJavajdk1.7.0_09”



in my jmonkeyplatform.conf seems to sort it out. No idea why it picked up the 32bit JVM on this machine, and 64bit one on the other (both machines had both JDKs installed).