Patent ID: 8024505

Claim:
A system for optimistic creation of thread local objects in a virtual machine environment, comprising: a computer including a processor and a virtual machine for executing a software application; a memory space, for use by the virtual machine in storing software objects and pointers as part of the software application, wherein the memory space includes a global heap and a plurality of thread local heaps stored as pages therein; a page fault optimizer, which enables the virtual machine to associate separate threads within the software application process with separate pages in memory, for use by the threads in storing their thread local heaps, and mark particular pages storing particular thread local heaps as readable only by their associated threads, so that access to those particular pages and thread local heaps by other threads are detected as page faults and cause the virtual machine to generate a promotion signal; a heap maintaining logic that maintains the global heap and the plurality of thread local heaps in a state suitable for efficient garbage collecting, including maintaining a plurality of thread pointer buffers, including a separate thread pointer buffer for each thread, wherein, for each particular thread its thread pointer buffer contains pointers to all object variables located in the global heap that point to objects located inside that particular thread's local heap, and when it is determined, in response to a promotion signal from the virtual machine, that an object in a first thread local heap is accessed from a second, different, thread within the plurality of local threads, then copying that object from the first thread local heap to the global heap, determining, using the thread pointer buffer for the first thread local heap, all references to that object from the global heap, and modifying other objects that are stored in the global heap, so that all references in the global heap that previously pointed to that object's previous location in the first thread local heap, point instead to that object's new location in the global heap; and a garbage collector that collects the thread local heaps, including deleting copies of objects within the thread local heaps that have been promoted to the global heap.