April 2018
Intermediate to advanced
300 pages
7h 41m
English
Memory allocation is the process of allocating objects in memory when the application is running. It is done by the Common Language Runtime (CLR). When the object is initialized (using a new keyword), the GC checks whether the generation reaches the threshold and performs garbage collection. This means that when the system memory reaches its limit, the GC is invoked. When an application runs, the GC register itself receives an event notification about the system memory, and when the system reaches its particular limit, it invokes garbage collection.
On the other hand, we can also programmatically invoke the GC using the GC.Collect method. However, as the GC is a highly fine-tuned algorithm and automatically ...