title: Memory comsumption of a process initiated by Java ProcessBuilder
body: <p>Is there a way to limit memory consumption of a process initiated by java processbuilder ? 
  or 
  to get the maximum memory used by the process?</p>
  
  <p>I have tried using the following code..but is always returns 0.</p>
  
  <pre><code>ProcessBuilder p = new ProcessBuilder(command);
  before=Runtime.getRuntime().totalMemory()-Runtime.getRuntime().freeMemory();
  Process pp = p.start();
  after=Runtime.getRuntime().totalMemory()-Runtime.getRuntime().freeMemory();
  System.out.println("Used : "+before-after);
  </code></pre>
  
  <p>I am a beginner..please pardon if the question is silly...</p>