title: Setting heap size in Java
body: <p>I am trying to run a Java tool in Linux Ubuntu system and I keep getting the following error after the program imports 12% of the data:</p>
  
  <pre><code>Fata Error:
  Exception in thread 'Thread-l" java.lang.OutOfMemoryError: java heap space
  </code></pre>
  
  <p>I tried to set the heap size using </p>
  
  <pre><code>java -Xms8G -Xmx16G -jar Haploview.jar
  </code></pre>
  
  <p>but the error appears again exactly at same point after just using less than 500M Of the allocated Ram. 
  Using the command 'free -m' I can see that there are lots of free RAM memory left but I don't know why Java do not use it </p>