Patent ID: 6957237

Claim:
A method for managing a virtual heap for a process executing within a virtual machine executing within a device, the method comprising: providing a store heap for the process, wherein the store heap is comprised in the virtual heap; providing an in-memory heap for the process, wherein the in-memory heap comprises a cached portion of the store heap for the process, and wherein the in-memory heap is comprised in the virtual heap; performing an atomic transaction on the virtual heap, wherein said performing the atomic transaction comprises performing one or more transaction tasks, and wherein said performing the atomic transaction changes a state of the virtual heap by modifying one or more portions of the virtual heap; committing the atomic transaction by accepting the modifications to the one or more portions of the virtual heap if the one or more transaction tasks in the atomic transaction are performed without generating an error; and rejecting the atomic transaction by restoring the virtual heap to the state of the virtual heap prior to said performing the atomic transaction if one or more of the one or more transaction tasks in the atomic transaction generates an error when performed.