Efficient object pinning in a multi-threaded environment
AssigneeOracle America, Inc.
InventorAntonios Printezis
Life of this patent
Estimating the term…
Abstract
Improvements to apparatus, methods, and computer program products are disclosed to improve the efficiency of pinning objects in a heap memory that is subject to a garbage collection system.
Claims16
A computer controlled method to effectuate a garbage collection system, wherein the method comprises:
- pinning an object, wherein the object is unfixed in a heap memory, and wherein the pinning comprises adding the object to a list of thread-pinned objects associated with a thread-context;
- adding a pointer to the object in the list of thread-pinned objects, wherein the pointer references a first allocated memory region in the heap memory, wherein the memory region remains unfixed prior to tracing said thread-context;
- wherein tracing said thread-context occurs subsequent to adding said pointer but prior to removing said pointer from said list of thread-pinned objects, and tracing said thread-context further comprises:
- retrieving said pointer from said list of thread-pinned objects;
- and
- fixing said object to said first allocated memory region such that said object will not be relocated;
- removing said pointer from said list of thread-pinned objects after tracing said thread-context is complete;
- and
- releasing said object from said first allocated memory region whereby said object can be relocated by said garbage collection system to a second allocated memory region at a second memory location within said heap memory while said object is live.
An apparatus having a central processing unit (CPU) and a memory coupled to said CPU to effectuate a garbage collection system, comprising:
- a first pin logic configured to pin an object, wherein the object is unfixed in a heap memory, and wherein the pinning comprises adding the object to a list of thread-pinned objects associated with a thread-context;
- a second pin logic configured to add a pointer to the object in the list of thread-pinned objects, wherein the pointer references a first allocated memory region in the heap memory, wherein the memory region remains unfixed prior to a liveness determination logic tracing said thread-context;
- an unpin logic configured to remove said pointer from said list of thread-pinned objects after tracing said thread-context is complete;
- the liveness determination logic further comprising:
- an access logic configured to retrieve said pointer from said list of thread-pinned objects pinned collection;
- and
- a fix logic configured to fix said object to said first allocated memory region such that said object will not be relocated by a relocation logic;
- and
- a release logic configured to release said object from said first allocated memory region whereby said object can be relocated by the relocation logic, wherein the relocation logic is configured to relocate said object stored in a first allocated memory region at a first memory location within the heap memory to a second allocated memory region at a second memory location within the heap memory while said object is live.
A non-transitory computer program product comprising a computer-usable data carrier providing instructions that, when executed by a computer, cause said computer to perform a method to effectuate a garbage collection system, wherein the method comprises:
- pinning an object, wherein the object is unfixed in a heap memory, and wherein the pinning comprises adding the object to a list of thread-pinned objects associated with a thread-context;
- adding a pointer to the object in the list of thread-pinned objects, wherein the pointer that references a first allocated memory region in the heap memory, wherein the memory region remains unfixed prior to tracing said thread-context;
- wherein tracing said thread-context occurs subsequent to adding said pointer but prior to removing said pointer from said list of thread-pinned objects, and tracing said thread-context further comprises:
- retrieving said pointer from said list of thread-pinned objects;
- and
- fixing said object to said first allocated memory region such that said object will not be relocated;
- removing said pointer from said list of thread-pinned objects after tracing said thread-context is complete;
- and
- releasing said object from said first allocated memory region whereby said object can be relocated by said garbage collection system to a second allocated memory region at a second memory location within said heap memory while said object is live.
Dependencies are inferred from the claim text.