Patent ID: 7792880

Claim:
A method of moving arrays as part of a garbage collection process, the method comprising: using a collector for entering a collection phase of a garbage collection process, wherein said garbage collection process is interleaved with a real-time application; using a mutator for: determining a maximum contiguous array size to be allocated from a heap, wherein the maximum contiguous array size is selected in accordance with desired performance levels; dividing arrays into long arrays and short arrays, wherein long arrays are arrays that are above the maximum contiguous array size, and short arrays are arrays that are below or equal to the maximum contiguous array size; representing the long arrays as two-level arrays by partitioning the long arrays into a series of arraylets, wherein arraylets comprise a size that is a power of two; allocating the short arrays below the maximum contiguous array size in a contiguous manner; using opportunistic contiguous allocation for allocating as many arraylets as possible in a contiguous manner; allocating a remainder of the arraylets in the heap in a discontiguous manner; and moving the arrays and arraylets into memory according to their allocation to maximize a number of contiguous memory blocks that are filled, such that array access is optimized and fragmentation is minimized.