mark during sweep rather than mark then sweep presented by ram mantsour authors: chrisitan queinnec,...

21
Mark DURING Sweep rather than Mark then Sweep Presented by Ram Mantsour Authors: Chrisitan Queinnec, Barbara Beaudoing, Jean-Pierre Queille.

Upload: joanna-warner

Post on 18-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

Mark DURING Sweep rather than Mark then Sweep

Presented by Ram Mantsour

Authors:

Chrisitan Queinnec, Barbara Beaudoing, Jean-Pierre Queille.

Introduction Mark DURING Sweep is intended as

a real-time GC. Regular GCs introduces delays which

may affect real time applications. Features parallel collection algorithm

(concurrent marker sweeper and application)

Designed for real-time applications in embedded systems.

What Mark During Sweep has to fulfill Short and predictable response time

very short time lag between events and handler (approx 50 micro sec).

Guaranteed throughputTo avoid unexpected GCs.

Operation with Narrow memory. Execution time upper bound for an

allocating task.

Problems with Known schemes Stop-and-Copy wastes memory

and has problem with VM systems. Mark-and-sweep in stop-and-

collect mode even if introduces lazy sweep - has marking delay.

On-the-fly (concurrent mutator and collector) - possible mutator starvation.

Mark-During-Sweep - terminology. Roots in their usual meaning + free

list. Mutator and collector (marker and

sweeper). Tricolor marking (whether by header

bit or bitmap. Grey bit for mutator-marker cooperation).

“No black cell can point to a white cell” holds for mutator and marker (P1)

Mark-During-Sweep - terminology (cont) Marker phase is finished when all

Grey cell vanish. Sweeper claims all white cells as

garbage. Two generations operation -

sweeping current while marking the next.

Working schemes and (P1) hold for generation of the marker.

Mark-During-Sweep - terminology (cont).

Comparisons:

The Algorithm - conventions.

Left(i), right(i), colourN (i), shadeN(i). Cell is :

The Algorithm - conventions (cont). ShadeN(i): if the cell is white turn it

to Grey.

The Marker.

The Marker. (cont) Termination is ensured. Not the very efficient to simplify

proof.

The sweeper.

The Sweeper. (cont)

Shading is necessary for (P1). WhiteN is necessary for the N+2

marker.

The collector.

The Mutator.

Whenever an edge is redirected the target of the edge is shadeG+1ed.

G+1 is the generation of the current marker.

Case Analysis.

Incremental GC .

Memory size (M with 2*M ptrs). Mutator consumption speed (vE cells

to unit of times) Sweeper rate (rS ratio of reclaimed to

swept cells in unit of time). Free list length (L, and is

instantenous ). Marker rate (rM rate of marked/

visited).

Incremental GC. (cont)

No mutator starvation. M/L cells to visit by the marker and

the sweeper. L regulate the time of the GC. Two kind of real-time tasks can be

identified.

Variants

Flip flops rather than incrementing G

Blackening instead of shading in the sweeper.

Using a global counter of Grey cells instead of rescanning the heap (marker).

Mark recursively as much as possible then collect left “Greys”.

Conclusions

An algorithm for real-time embedded systems that has predictable response time, guaranteed throughput and can work with narrow memories.

Mutator marker and sweeper run concurrently.

The END