How does the JVM decided to JIT-compile a method (categorize a method as "hot")? : <p>I already worked with <code>-XX:+PrintCompilation</code>, and I know the basic techniques of the JIT-compiler and why JIT-compilation is used.</p>

<p>Yet I still have not found out how the JVM decides to JIT-compile a method, i.e. "when the right time has come to JIT-compile a method".</p>

<p>Am I right in the assumption that every method starts being interpreted, and as long as it is not categorized as "hot method" it will not be compiled? I have something in the back of my head that I read that a method is considered "hot" when it was executed at least 10.000 times (after interpreting the method 10.000 times, it will be compiled), but I have to admit that I am not sure about this or where I've read this.</p>

<p>So to sum up my question:</p>

<p>(1) Is <em>every</em> method interpreted as long as it not has been categorized as "hot" method (and therefore has been compiled) or are there reasons for methods to get compiled even if they are not "hot"? </p>

<p>(2) How does the JVM categorize methods into "non-hot" and "hot" methods? Number of execution? Anything else?</p>

<p>(3) If there are certain thresholds (like number of executions) for "hot" methods, are there Java flags (<code>-XX:...</code>) to set this thresholds?</p>
