Patent ID: 7966607

Claim:
A method for managing compiled program methods in a unified heap, comprising: partitioning the unified heap into a first area and a second area by using a partition located at a first location between the first area and the second area to define the first area and the second area; storing objects other than compiled program methods and temporary compiler data structures in the first area, wherein the objects include at least one of byte arrays, program method byte codes, classes, or user objects; storing only compiled program methods and temporary compiler data structures separately in the second area, upon receiving a program method to compile, estimating a size for the compiled program method and a size for the temporary compiler data structures to be used to compile the program method; determining if sufficient memory is available in the second area to accommodate the compiled program method and the temporary compiler data structures; and if so, allocating space in the second area for the compiled program method and the temporary compiler data structures; otherwise, performing at least one of: compacting the second area, or moving the partition from the first location to a second location between the first area and the second area to increase a size of a partition for the second area, and relocating all the compiled program methods in the second area nearer to the partition location.