title: Determine how much memory my app is using
body: <p>I have written a java program, and I want to see when it runs how much RAM it uses. Is there any way to see how much RAM usage is related to my program? I mean something like time usage of the program that can be seen by writing this code before and after calling the main code:</p>
  
  <pre><code>long startTime = System.currentTimeMillis();
  new Main();
  long endTime = System.currentTimeMillis();
  System.out.println("Total Time: " + (endTime - startTime));
  </code></pre>