Patent ID: 6996814

Claim:
A method for dynamically compiling byte codes into native code to facilitate faster execution, comprising: periodically determining if a currently executing thread is executing through the interpreter, wherein periodically determining if the currently executing thread is executing through the interpreter involves examining the currently executing thread after receiving an interrupt, wherein the interrupt is received from a tick timer that periodically generates interrupts for an operating system, and if so: locating a method currently being executed by the thread, and compiling byte codes of the method into native code so that subsequent executions of the method execute native code; periodically removing unused native code for methods in order to: a) free up memory space, thereby reclaiming memory space to be reused for subsequently compiled methods, and b) cause subsequent executions of the methods whose native code has been removed to revert to executing byte codes in interpreted mode; and continue executing through the interpreter without compiling byte codes into native codes if a predetermined threshold for a compiler used to compile the byte codes of the method is met, wherein conditions for meeting the predetermined threshold comprise: the compiler exceeding a processor time allowance, the compiler exceeding a memory usage allowance, or the compiler exceeding a memory storage quota.