mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-15 16:57:35 +02:00
Add img.doc class
This commit is contained in:
parent
c712702f10
commit
595f8e5c38
1 changed files with 4 additions and 4 deletions
|
@ -165,22 +165,22 @@ During a GC cycle the collector thread transitions through the following states.
|
||||||
### Clear
|
### Clear
|
||||||
The collector swaps the values of the clear color (white) and the mark color (black). This is more efficient than modifying the color on each object in the heap. The collector then transitions to sync 1. At this point no heap objects are marked, as demonstrated below:
|
The collector swaps the values of the clear color (white) and the mark color (black). This is more efficient than modifying the color on each object in the heap. The collector then transitions to sync 1. At this point no heap objects are marked, as demonstrated below:
|
||||||
|
|
||||||
<img src="images/gc-graph-clear.png" alt="Initial object graph">
|
<img class="doc" src="images/gc-graph-clear.png" alt="Initial object graph">
|
||||||
|
|
||||||
### Mark
|
### Mark
|
||||||
The collector transitions to sync 2 and then async. At this point it marks the global variables and waits for the mutators to also transition to async:
|
The collector transitions to sync 2 and then async. At this point it marks the global variables and waits for the mutators to also transition to async:
|
||||||
|
|
||||||
<img src="images/gc-graph-mark.png" alt="Initial object graph">
|
<img class="doc" src="images/gc-graph-mark.png" alt="Initial object graph">
|
||||||
|
|
||||||
### Trace
|
### Trace
|
||||||
The collector finds all live objects using a breadth-first search and marks them black:
|
The collector finds all live objects using a breadth-first search and marks them black:
|
||||||
|
|
||||||
<img src="images/gc-graph-trace.png" alt="Initial object graph">
|
<img class="doc" src="images/gc-graph-trace.png" alt="Initial object graph">
|
||||||
|
|
||||||
### Sweep
|
### Sweep
|
||||||
The collector scans the heap and frees memory used by all white objects:
|
The collector scans the heap and frees memory used by all white objects:
|
||||||
|
|
||||||
<img src="images/gc-graph-sweep.png" alt="Initial object graph">
|
<img class="doc" src="images/gc-graph-sweep.png" alt="Initial object graph">
|
||||||
|
|
||||||
If the heap is still low on memory at this point the heap will be increased in size. Also, to ensure a complete collection, data for any terminated threads is not freed until now.
|
If the heap is still low on memory at this point the heap will be increased in size. Also, to ensure a complete collection, data for any terminated threads is not freed until now.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue