bamword15 / jmonkeyengine

Automatically exported from code.google.com/p/jmonkeyengine
0 stars 0 forks source link

Starting two SimpleApplications in a row in the same JVM process in Headless mode is unreasonably slow #598

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
The following program demonstrates the issue:

import com.jme3.app.SimpleApplication;
import com.jme3.system.JmeContext;
import java.util.logging.Level;
import java.util.logging.Logger;

public class Jmetest extends SimpleApplication{
    public static void main(String[] args){
        try {
            Logger.getLogger("org.lwjgl").setLevel(Level.SEVERE);
            Logger.getLogger("com.jme3").setLevel(Level.SEVERE);
            Logger.getLogger("").setLevel(Level.SEVERE);

            Jmetest t1 = new Jmetest();
            t1.start(JmeContext.Type.Headless);
            Thread.sleep(2000);
            t1.stop();

            Jmetest t2 = new Jmetest();
            t2.start(JmeContext.Type.Headless);
            Thread.sleep(10000);
            t2.stop();
        }
        catch (Exception e) {}
    }

    public Jmetest() {
    }

    @Override
        public void simpleInitApp() {
            System.out.println("simpleInitApp():");
        }

    @Override
        public void simpleUpdate(float tpf) {
            try {
                Thread.sleep(50);
                System.out.println("simpleUpdate()");
            } catch (Exception e) {}
        }
}

The time between the first and the second call to simpleUpdate is like 2-3 
seconds for the second instance, t2. This problem does not occur in Display 
mode. Something pathological is most likely going on.

Original issue reported on code.google.com by oskar.kv...@gmail.com on 29 Aug 2013 at 3:07

GoogleCodeExporter commented 8 years ago
The version of jME: Checkout from the SVN repo on the 15th of August, 2013.

Original comment by oskar.kv...@gmail.com on 29 Aug 2013 at 3:09