title: How to dynamically set java memory size in bash?
body: <pre><code>#!/bin/bash
  #
  module add apps/java/1.6 
  java -Xmx1024m HelloWorld
  </code></pre>
  
  <p>I need to set <code>-XmxYm</code> where <code>Y</code> should be the 95% of available memory on the system in Mb. </p>