Patent ID: 7546588

Claim:
A method to select one of a plurality of reflexive code paths for execution of a task by a computer system, the method comprising: determining performance characteristics from execution of the task by each of the plurality of reflexive code paths, each performance characteristic being attributable to a different code path of the code paths; wherein in response to a memory allocation request for memory for the task, a first code path of the code paths invokes a linear allocation of the requested memory and a second code path of the code paths invokes a non-linear allocation of the requested memory; wherein the non-linear allocation of the requested memory divides the memory into a number of contiguous granules of equal size, and the linear allocation of the requested memory divides the memory into at least a first section and a second section, the first and second sections being contiguous and non-overlapping, wherein the first section is evenly divided into a plurality of granules of a first equal size and the second section is evenly divided into a plurality of granules of a second equal size twice as large as the first equal size, wherein the usage of the granules out of each of the sections is tracked and a size of the memory allocation request from the task against the granules in the sections to select one section of the sections is compared, and assigns the smallest granule size available in the two sections that is closest to and satisfies the size of the memory request to allocate a smallest granule size from the section in response to the memory allocation request; comparing the performance characteristics to identify one code path of the first and second code paths that increases performance based upon the characteristics; selecting the identified code path to be executed in a subsequent execution of the task; changing the state of a switch to the selection of the identified code path; and executing the one identified code path during the subsequent execution of the task by the computer system.