title: how to set default maximum heap size for Java (xmx), for linux (centos)
body: <p>I have many small java programs running in crons in my server. I have an openvz VPS, and java is very poblematic with memory and openvz.</p>
  
  <p>The best solution i have  come up so far is running my programs with:</p>
  
  <pre><code>java -Xmx16m class
  </code></pre>
  
  <p>This works ok, but I have many programs running, and i want to set the default maximum heap for all the system, so that i don't change all the start up scripts, and not have to remember to do that every time i write a new one.</p>
  
  <p>I tried finding a way to set/change a global default value for my CentOS system, but i had no luck with that!</p>
  
  <p>I would appreciate if someone could help me.</p>
  
  <p>Thanks.</p>