title: How much memory must be left to the OS with a java server application?
body: <p>Suppose I am running tomcat with -Xms256m -Xmx1024m, but would like to increase my heap usage. </p>
  
  <p>What is the largest safe heap size I can allocate? </p>
  
  <p>For the purpose of this question, please assume, the system has 5GB RAM and is a z/Linux system. However, if possible I would like a broader rule of thumb answer.</p>
  
  <p>This is dedicated system, so I am mostly worried about the OS memory usage. I am not worried about other programs.</p>
  
  <p>Also, if this is a duplicate, sorry. I was surprised I did not find more information on this kind of thing.  </p>
  
  <p>GC</p>
  
  <p>PS: I understand there may be some more system information needed.  I don't mind if the answer details how to find an answer, rather than giving me a number.</p>