Thanks, Erik. Very nice answer!
So it seems there are two ways to determine whether a method is hot or not: one is sampling-based, the other is (invocation) counter-based.
The former prefers methods with longer accumulated execution time, while the later prefers methods with more invocations so far, right?
May I have a further question?
I tested the command line arguments you suggested: "-X:aos:printOptions",
from which I found two interesting options as below:
method_sample_size = 3
counter_based_sample_interval = 1000
It seems the first one is the threshold (# of samples a method got) to determine a method is "hot" or not,
and the second one is the sampling rate (in the default setting, it is taking 1 sample every 1000 msecs).
Is my understanding correct?
I observed the changing of method_sample_size affects the # of methods opt-compiled.
However, I did not see counter_based_sample_interval affect the # of methods opt-compiled at all.
Did I miss anything?