IP Library Granted Patent US 9,690,701
Granted Patent B1
US 9,690,701 · App. 15/277,234 · Granted Jun 27, 2017

Probabilistic, parallel collection of memory no longer in use

Inventors: Eli M. Dow (Wappingers Falls, NY); Thomas D. Fitzsimmons (Poughkeepsie, NY); Jia Sen Wu (Jiangsu, CN); Bao Zhang (Beijing, CN)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06F12/0253G06F17/30864G06F2212/702
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,690,701
App. No.
15/277,234
Granted
Jun 27, 2017
Kind
B1
Abstract

A computer-implemented method includes performing, by each of a plurality of crawlers, a random walk of a plurality of objects in a heap, where the plurality of objects are memory objects allocated for execution of an application. A timestamp of each object of the plurality of objects is updated, when the object is visited by a crawler of the plurality of crawlers. Garbage is identified, by a computer processor, based at least in part on the timestamp of each object of the plurality of objects. The garbage is reclaimed.

Claims (57)

1. A computer-implemented method, comprising:

performing, by each of a plurality of crawlers, a random walk of a plurality of objects in a heap, wherein the plurality of objects are memory objects allocated for execution of an application, and wherein the plurality of objects form a tree;

associating a probability with each directed edge of the tree;

wherein a total probability of directed edges entering each object of the plurality of objects equals a total probability of directed edges exiting the object;

wherein each object of one or more objects, from among the plurality of objects, comprises a loop edge both entering and exiting the object;

wherein a transition matrix representing the tree is doubly stochastic;

updating a timestamp of each object of the plurality of objects, when the object is visited by a crawler of the plurality of crawlers;

identifying, by a computer processor, garbage based at least in part on the timestamp of each object of the plurality of objects; and

reclaiming the garbage identified.

2. The computer-implemented method of claim 1 , wherein the performing the random walk, the updating the timestamp of each object, the identifying the garbage, and the reclaiming the garbage are performed without a Stop the World phase.

3. The computer-implemented method of claim 1 , wherein the plurality of objects are visited by the plurality of crawlers with equal chance.

4. The computer-implemented method of claim 1 , wherein the performing the random walk and the identifying the garbage are performed in parallel.

5. The computer-implemented method of claim 1 , wherein the identifying the garbage based at least in part on the timestamp of each object of the plurality of objects comprises:

scanning the heap for a set of candidate objects having timestamps outside a threshold difference from a current time; and

identifying a subset of the candidate objects as the garbage.

6. The computer-implemented method of claim 5 , wherein the identifying the subset of the candidate objects as garbage comprises:

identifying a set of boundary objects as parents of the set of candidate objects;

removing from the set of candidate objects one or more objects that are reachable from the set of boundary objects; and

identifying a remainder of the candidate objects as the garbage, after removing from the set of candidate objects the one or more objects that are reachable from the set of boundary objects.

7. A system comprising:

a memory having computer-readable instructions; and

one or more processors for executing the computer-readable instructions, the computer-readable instructions comprising:

performing, by each of a plurality of crawlers, a random walk of a plurality of objects in a heap, wherein the plurality of objects are memory objects allocated for execution of an application, and wherein the plurality of objects form a tree;

associating a probability with each directed edge of the tree;

wherein a total probability of directed edges entering each object of the plurality of objects equals a total probability of directed edges exiting the object;

wherein each object of one or more objects, from among the plurality of objects, comprises a loop edge both entering and exiting the object;

wherein a transition matrix representing the tree is doubly stochastic;

updating a timestamp of each object of the plurality of objects, when the object is visited by a crawler of the plurality of crawlers;

identifying garbage based at least in part on the timestamp of each object of the plurality of objects; and

reclaiming the garbage identified.

8. The system of claim 7 , wherein the performing the random walk, the updating the timestamp of each object, the identifying the garbage, and the reclaiming the garbage are performed without a Stop the World phase.

9. The system of claim 7 , wherein the plurality of objects are visited by the plurality of crawlers with equal chance.

10. The system of claim 7 , wherein the performing the random walk and the identifying the garbage are performed in parallel.

11. The system of claim 7 , wherein the identifying the garbage based at least in part on the timestamp of each object of the plurality of objects comprises:

scanning the heap for a set of candidate objects having timestamps outside a threshold difference from a current time; and

identifying a subset of the candidate objects as the garbage.

12. The system of claim 11 , wherein the identifying the subset of the candidate objects as garbage comprises:

identifying a set of boundary objects as parents of the set of candidate objects;

removing from the set of candidate objects one or more objects that are reachable from the set of boundary objects; and

identifying a remainder of the candidate objects as the garbage, after removing from the set of candidate objects the one or more objects that are reachable from the set of boundary objects.

13. A computer-program product for garbage collection, the computer program product comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform a method comprising:

performing, by each of a plurality of crawlers, a random walk of a plurality of objects in a heap, wherein the plurality of objects are memory objects allocated for execution of an application, and wherein the plurality of objects form a tree;

associating a probability with each directed edge of the tree;

wherein a total probability of directed edges entering each object of the plurality of objects equals a total probability of directed edges exiting the object;

wherein each object of one or more objects, from among the plurality of objects, comprises a loop edge both entering and exiting the object;

wherein a transition matrix representing the tree is doubly stochastic;

updating a timestamp of each object of the plurality of objects, when the object is visited by a crawler of the plurality of crawlers;

identifying garbage based at least in part on the timestamp of each object of the plurality of objects; and

reclaiming the garbage identified.

14. The computer-program product of claim 13 , wherein the performing the random walk, the updating the timestamp of each object, the identifying the garbage, and the reclaiming the garbage are performed without a Stop the World phase.

15. The computer-program product of claim 13 , wherein the plurality of objects are visited by the plurality of crawlers with equal chance.

16. The computer-program product of claim 13 , wherein the performing the random walk and the identifying the garbage are performed in parallel.

17. The computer-program product of claim 13 , wherein the identifying the garbage based at least in part on the timestamp of each object of the plurality of objects comprises:

scanning the heap for a set of candidate objects having timestamps outside a threshold difference from a current time;

identifying a set of boundary objects as parents of the set of candidate objects;

removing from the set of candidate objects one or more objects that are reachable from the set of boundary objects; and

identifying a remainder of the candidate objects as the garbage, after removing from the set of candidate objects the one or more objects that are reachable from the set of boundary objects.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 27, 2016
From: DOW, ELI M.; FITZSIMMONS, THOMAS D.; WU, JIA SEN; ZHANG, BAO
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 039866/0927 →