# The `GC` Process
+ **_1_** On `compaction` completed, update discardable size and calculate `GC` score
+ **_2_** Select multiple `BLOB` files from the largest score to smallest score as candidate files
+ **_3_** Sample each `BLOB` file from candidate files, if the amount of discardable data does NOT exceed the **`DISCARD_RATIO`** (configurable), remove it from candidate files
+ **_4_** Iterate through all `KV` pairs in the candidate `BLOB` files, merge and sort all active values to a new `BLOB` file
+ **_5_** Write new records of adding new `BLOB` files to `MANIFEST` log
+ **_6_** Rewrite all valid `key-index` pairs to `LSM-Tree`
+ **_7_** Write new records of deleting old `BLOB` files to `MANIFEST` log

----------------------------------------------------------------

