Patent ID: 8146065

Claim:
A computer implemented method for managing just-in-time compilation, the computer implemented method comprising the steps of: designating, by a data processing system, a set of compilation threads for performing compilation functions associated with an application; designating, by the data processing system, a set of computation threads for executing the application; allocating, by the data processing system, processor cycles within a processor between the set of compilation threads and the set of computation threads throughout each time interval in a plurality of time intervals during runtime, wherein processor cycles within the processor are allocated between the set of compilation threads and the set of computation threads to maintain a ratio of processor cycles consumed by the set of compilation threads to processor cycles consumed by the set of computation threads within the processor throughout each time interval in the plurality of time intervals, and wherein the set of compilation threads yields the processor to the set of computation threads when a compilation time budget threshold is exceeded for the time interval in the plurality of time intervals; determining, by the data processing system, whether a compilation thread in the set of compilation threads needs to compile a method during a current time interval in the plurality of time intervals by checking a first compilation queue for a compilation request; responsive to a determination that the compilation thread in the set of compilation threads does not need to compile a method during a current time interval in the plurality of time intervals, carrying, by the data processing system, a compilation time budget surplus into a next time interval in the plurality of time intervals; responsive to a determination that the compilation thread in the set of compilation threads does need to compile a method during a current time interval in the plurality of time intervals, determining, by the data processing system, time spent compiling the method for the current time interval; comparing, by the data processing system, the time spent compiling the method for the current time interval to a compilation time budget for the current time interval; responsive to determining that the time spent compiling the method for the current time interval is greater than the compilation time budget for the current time interval, lowering, by the data processing system, an optimization level for the method; responsive to lowering the optimization level for the method, cloning, by the data processing system, the compilation request and placing the cloned compilation request in a second compilation queue; and responsive to cloning the compilation request and placing the cloned compilation request in the second compilation queue, carrying, by the data processing system, a compilation time budget deficit into the next time interval in the plurality of time intervals.