From what i understand the gc algorithm works like this.
- Low memory notification
- GC will collect the generation 0
- If the collection of the generation 0 was not enough the GC will procceed with the generation 1, 2 and 3.
Side note: The collection of every generation has a performance cost.
The generation 0 has the lowest impact and the generation 3 has the highest impact.
This happens because the generation 0 is the newest and the lowest on risk. (If the objects stayed on the generation 0 its because they are not important or they are recently allocated.)
The generation 1 is the stack of objects that were on generation 0 and lived long enough (or survived from a GC.Collect)
The same goes for the generation 2 but this time the stack of objects were on generation 1.
The generation 3 is a special generation that holds large objects and will get collected as a last resort.
You can find more information about this on the Book Of runtime - Garbage Collection.