LOH (Large heap of objects) is a single heap where large objects are distributed directly and remain there until they are collected. Objects are directly allocated in LOH based on their size, for example. equal to or greater than 85,000 bytes.
Generation objects are βsmallβ objects that stand out in SOH (Small Object Heap), which is a single heap. Objects in SOH have an associated generation, which indicates how many collections they survived to the maximum generation, for example. 2. When the number of generations starts from 0, the object in generation 2 can be described as the 3rd generation, since it survived from at least 3 collections, that is, generations 0,1,2.
Generations help optimize garbage scanning. Long-lived objects increase the number of their generations, as they survive in collections, and generations with a higher number are scanned less often. This mechanism leads to the fact that objects that are short-lived are scanned less frequently and, therefore, unnecessarily. The generation scheme is applied to SOH because it is considered as a good optimization for a heap where there will be many objects.
Update
As far as I understand, LOH objects are reported as being in maximum generation, but I believe that this is just the default value. They are not actually in any generation, that is, 2 generations of SOH objects and LOH objects are not in the same "list". However, as @Henk noted, when executing the Generation 2 collection, LOH objects are also collected at this time. Thus, conceptually there is a relationship between generation 2 and LOH. This is true for .Net 2.0:
See: Inaccessible heap of large objects
From the point of view of generations, large objects belong to generation 2, because they are collected only when there is a collection of generation 2.
However, although the relationship of the collection is obvious, an example where it is not fulfilled is the generation seal. When a generation gathers, it can also be condensed. LOH, however, does not condense, therefore it cannot be said that everything that happens to objects of generation 2 happens to objects in LOH.
[Test] public void large_object_heap_objects_are_reported_as_max_generation() { int[] bling = new int[85000 / 4]; int maxGen = GC.MaxGeneration; int objectGen = GC.GetGeneration(bling); Assert.AreEqual(maxGen, objectGen, "Large object is at max generation."); }