Assets library link

Hello



I have a main project that uses another project(assets/src) cos it is needed by the game and the gameserver project too



as i run the main project in the ide, no problem

but as i compile for distribution, i always have to copy the assets.jar from the library project dis/lib folder to the main dist/lib folder



is there a way to automatize this ? do i do anything wrong ?



thx

I added a dependency on the library project from the client project and it all just worked…

Reference the other projects dist jars instead of the project or just add the jars that you want in your main project distro to its setzing if you want to reference the project.

so simple, so it overid the jar that is in the main project

i’ll check that out

thx everyone

@normen said:
Reference the other projects dist jars instead of the project or just add the jars that you want in your main project distro to its setzing if you want to reference the project.


so what i have done is changed the asset folder in the Properties/Asset settings

but i get again "java.lang.OutOfMemoryError: Direct buffer memory"

with this command line

java -jar "Robot Monk.jar" +buffer +debug -XX:MaxDirectMemorySize=4096m -Xmx4096m -Xms4096m

my pc goes up to 3gb of actual memory
gpu is an Nvidia Geforce6150SE 430 (cant say how much memory is on the card thought)

it seems ot happen when i create the vegetation meshes wich contains a lot of faces
it works perfectly in the ide
my asset.jar is only 132megs

any idea what could go wrong?
Code:
... juil. 07, 2012 1:43:46 AM com.jme3.app.Application handleError Grave: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main] java.lang.OutOfMemoryError: Direct buffer memory at java.nio.Bits.reserveMemory(Unknown Source) at java.nio.DirectByteBuffer.<init>(Unknown Source) at java.nio.ByteBuffer.allocateDirect(Unknown Source) at com.jme3.util.BufferUtils.createByteBuffer(BufferUtils.java:909) at com.jme3.texture.plugins.AWTLoader.load(AWTLoader.java:114) at com.jme3.texture.plugins.AWTLoader.load(AWTLoader.java:192) at com.jme3.texture.plugins.AWTLoader.load(AWTLoader.java:201) at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java :282) at com.jme3.asset.DesktopAssetManager.loadTexture(DesktopAssetManager.ja va:345) at com.jme3.material.plugins.J3MLoader.readValue(J3MLoader.java:148) at com.jme3.material.plugins.J3MLoader.readValueParam(J3MLoader.java:277 ) at com.jme3.material.plugins.J3MLoader.readExtendingMaterialParams(J3MLo ader.java:293) at com.jme3.material.plugins.J3MLoader.loadFromRoot(J3MLoader.java:487) at com.jme3.material.plugins.J3MLoader.load(J3MLoader.java:511) at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java :282) at com.jme3.asset.DesktopAssetManager.loadMaterial(DesktopAssetManager.j ava:349) at mygame.Tools.CreateVegetationMesh(Tools.java:89) at mygame.factories.EnvironementFactory.CreateVegetation(EnvironementFac tory.java:1269) at mygame.Main.CreateGameLevelStep(Main.java:404) at mygame.screens.PreparingScreen.Update(PreparingScreen.java:86) at mygame.Main.UpdateNifty(Main.java:2197) at mygame.Main.simpleUpdate(Main.java:807) at mygame.MyApplication.update(MyApplication.java:211) at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDispl ay.java:151) at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:182) at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.j ava:228) at java.lang.Thread.run(Unknown Source)

juil. 07, 2012 1:43:46 AM com.jme3.renderer.lwjgl.LwjglRenderer cleanup
Infos: Deleting objects and invalidating state
juil. 07, 2012 1:43:46 AM com.jme3.input.lwjgl.LwjglMouseInput destroy
Infos: Mouse destroyed.
juil. 07, 2012 1:43:46 AM com.jme3.input.lwjgl.LwjglKeyInput destroy
Infos: Keyboard destroyed.
juil. 07, 2012 1:43:46 AM com.jme3.system.lwjgl.LwjglAbstractDisplay deinitInThr
ead
Infos: Display destroyed.

C:WORKjMonkeyProjectsRobotMonkdist>cd /

C:>pause
Appuyez sur une touche pour continuer…

info : the application takes up to 700mb of ram in the task manager and nothing else runs

Use a smaller java heap size so the gc occurs more often, do not use such excessive sizes at all, how you come up with 8GB of mem for a 3GB machine?! Direct memory doesn’t trigger the GC so you can bail yourself out of memory with that. What you see in your task manager doesn’t say too much about the java memory usage as the actual system memory size is dependent on various things.

@normen said:
Use a smaller _java_ heap size so the gc occurs more often, do not use such excessive sizes at all, how you come up with 8GB of mem for a 3GB machine?! Direct memory doesn't trigger the GC so you can bail yourself out of memory with that. What you see in your task manager doesn't say too much about the java memory usage as the actual system memory size is dependent on various things.


it was first set to 128 becos of the las out of memory error, it worked for a while
and in the ide, mem goes up to 230mb in the toolbar, game runs no problem (???)

before error is shown :

Maximum Memory : 247mb
Reserved Memory : 240mb
Code:
Class c = Class.forName("java.nio.Bits"); Field maxMemory = c.getDeclaredField("maxMemory"); maxMemory.setAccessible(true); Field reservedMemory = c.getDeclaredField("reservedMemory"); reservedMemory.setAccessible(true); synchronized (c) { Long maxMemoryValue = (Long)maxMemory.get(null); Long reservedMemoryValue = (Long)reservedMemory.get(null); System.out.println("=================================================================="); System.out.println("Maximum Memory : "+(maxMemoryValue/1024/1024)+"mb"); System.out.println("Reserved Memory : "+(reservedMemoryValue/1024/1024)+"mb"); System.out.println("=================================================================="); }

i'll try other walues like 128