| CPC G06F 12/0253 (2013.01) | 20 Claims |

|
8. A method, comprising:
executing a first thread, wherein executing the first thread comprises storing a first set of objects to a first private memory region;
detecting termination of the first thread;
determining whether the first set of objects is exclusive of any shared objects accessible by one or more additional threads to select a first garbage collection process from a group of garbage collection processes comprising a sweeping thread-local garbage collection process and a selective garbage collection process;
responsive to determining that the first set of objects is exclusive of any shared objects accessible by one or more additional threads: executing the sweeping thread-local garbage collection process comprising reclaiming the first private memory region;
executing a second thread, wherein executing the second thread comprises storing a second set of objects to a second private memory region;
detecting termination of the second thread;
determining whether the second set of objects is exclusive of any shared objects accessible by one or more additional threads to select a second garbage collection process from the group of garbage collection processes comprising the sweeping thread-local garbage collection process and the selective garbage collection process;
responsive to determining that the second set of objects includes at least one shared object accessible by one or more additional threads: executing the selective garbage collection process comprising selectively reclaiming a second subset of memory blocks from the second private memory region allocated for a subset of private objects of the second set of objects, wherein the subset of private objects are inaccessible from any thread;
wherein the method is performed by at least one device including a hardware processor.
|