title: External program runs slow when launched from java
body: <p>I am launching an application from Java using the getRuntime().exec(...) method, everything works perfectly except for one thing: the program (a 3d robot simulator in my case) runs slower compared to when I run it using a terminal window, that is: when running a task the simulator can take 10 more seconds when launched from Java compared to running the same task when launched from a terminal.</p>
  
  <p>What could be causing this behaviour? </p>
  
  <p>I have tried increasing the memory available to the JVM to 4 GB using -Xmx and -Xms but with the same result, I am using mpj-express to open and manage various simulators at the same time and the code I am using to launch each simulator is:</p>
  
  <pre><code>try{
      Runtime rt = Runtime.getRuntime();
      rt.exec("/home/.../sim.sh");
      Thread.sleep(3000);
  } catch(Exception e) {
      System.out.println(e.toString());
      e.printStackTrace();
  }
  </code></pre>
  
  <p>I am running Linux 14.04 64 bits on a four core Intel Core i5 with 8 GB of RAM and my Java version is:</p>
  
  <pre><code>java version "1.8.0_20"
  Java(TM) SE Runtime Environment (build 1.8.0_20-b26)
  Java HotSpot(TM) 64-Bit Server VM (build 25.20-b23, mixed mode)
  </code></pre>
  
  <p>Thanks</p>