title: multiple java instances -Xms -Xmx
body: <p>I am running at the same computer a java game-server and a game-client</p>
  
  <p>the game-client with </p>
  
  <p><code>java -Xms512m -Xmx1024m -cp etc etc</code></p>
  
  <p>and the game-server</p>
  
  <p><code>java -Xmx1024M -Xms1024M -jar etc etc</code></p>
  
  <p>Computer Properties:</p>
  
  <ul>
  <li>Windows 7 64 bit</li>
  <li>8GB RAM</li>
  <li>CPU i5-2500 @ 3.3GHz</li>
  <li>Intel HD Graphics</li>
  </ul>
  
  <p><em>Problem:</em> The game-client experience serious lags. At the game-server is also connected via LAN another player with no lag issues! </p>
  
  <p>Has the problem of the lag to do anything with java virtual machine? Am I using one instance of machine or two? </p>
  
  <p>Can I setup something different in order to optimize the performance? </p>
  
  <p>I am thinking that the problem has to do with the fact that one machine is running and its max memory is not enough for both instances, but I do not really know how to solve that.</p>
  
  <p><strong>Edit:</strong> No app run out of memory.</p>
  
  <hr>
  
  <p><em><strong>Solution</strong>:</em></p>
  
  <p>1: 
  Updated Java version from:</p>
  
  <pre><code>java version "1.6.0_31"
  Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
  Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)
  </code></pre>
  
  <p>to </p>
  
  <pre><code>java version "1.7.0_15"
  Java(TM) SE Runtime Environment (build 1.7.0_15-b03)
  Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)
  </code></pre>
  
  <p>2: 
  Changed the server properties in order to minimize requirements, this seems to be the main reason.</p>
  
  <p>3:
  Increased memory:
  game-client with <code>java -Xms1024m -Xmx1024m -cp etc etc</code>
  and the game-server <code>java -Xmx2048M -Xms2048M -jar etc etc</code>
  Server runs at about 700MB now.</p>