Patent ID: 7165255

Claim:
A method for managing heap memory in a multitasking system, comprising: reserving a guaranteed amount of heap memory for a task from a common heap in the multitasking system, wherein the heap memory reserved for the task is separate from heap memory reserved for all other tasks in the common heap of the multitasking system; receiving a request from the task to allocate heap memory for a new object; and if heap memory is available in the guaranteed amount of heap memory for the task, allocating heap memory for the new object from the guaranteed amount of heap memory; if heap memory is not available in the guaranteed amount of heap memory, checking if surplus heap memory is available in the common heap; if surplus heap memory is available, reserving an additional amount of heap memory to the task from the common heap and allocating heap memory for the new object from the additional amount of heap memory, whereby allocating heap memory for the new object from the additional amount of heap memory delays garbage collection; and if surplus heap memory is not available, performing garbage collection on the heap memory reserved for the task, wherein the task space is separate from all other task spaces; wherein other tasks continue normal execution without interruption due to garbage collection.