1. A method for determining a frequency of execution of compiled methods within a virtual machine, the method comprising: when a compiled method is executed, setting a flag corresponding to the compiled method to indicate that the compiled method is executing; periodically, scanning the flag and incrementing the value of a corresponding counter if the flag is set, and then resetting the flag; and analyzing the value of the counter to determine a frequency of execution of the compiled method.