US 12,306,750 B1
Selecting garbage collection processes
Erik Österlund, Vasterhaninge (SE); Axel Boldt-Christmas, Stockholm (SE); and Stefan Mats Rikard Karlsson, Nacka (SE)
Assigned to Oracle International Corporation, Redwood Shores, CA (US)
Filed by Oracle International Corporation, Redwood Shores, CA (US)
Filed on Feb. 22, 2024, as Appl. No. 18/584,779.
Int. Cl. G06F 12/02 (2006.01)
CPC G06F 12/0253 (2013.01) 20 Claims
OG exemplary drawing
 
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.