Total memory used by Tomcat
<p>I have read this article <strong>Find out your Java heap memory size</strong>
<a href="http://www.mkyong.com/java/find-out-your-java-heap-memory-size/" rel="nofollow">http://www.mkyong.com/java/find-out-your-java-heap-memory-size/</a> is helpful for me to understand the memory used by Tomcat.</p>

<p>According to the above article, the total memory is:</p>

<p>heap + perm + stack (threads)</p>

<p>I have the following questions:</p>

<ol>
<li><p>If we set a max on the heap and perm, am I right that the total memory used by Tomcat depends on the number of threads? </p></li>
<li><p>Each thread uses both stack memory for itself and heap memory (because it creates objects)?</p></li>
<li><p>The more memory a machine has, the more threads Tomcat can serve, up to the point where either heap or the server runs out of available memory? At that point, JVM throws the OutOfMemory execption?</p></li>
</ol>

<p>Thanks!</p>