diff --git a/guide/english/computer-science/garbage-collection/index.md b/guide/english/computer-science/garbage-collection/index.md index 3bb8853a35..5dbd29981d 100644 --- a/guide/english/computer-science/garbage-collection/index.md +++ b/guide/english/computer-science/garbage-collection/index.md @@ -14,7 +14,7 @@ As said above, every programming language has their own way of GC. In C programm #### How memory allocation happening? In C#, memory allocation of objects happens in a managed heap. which takes care by CLR (common language runtime). Memory allocation for the heap is done through win32 dll in OS as like in the C. But, In C objects are placed in memory where ever the free space suits the size of object. And, the memory mapping is woks based on Linkedlist concepts. In C#, memory allocation for heap is happening in linear manner. like one after another. -Whenever a new object is being created. A memory is allocated in the heap and the pointer moved to next memory address. Memory allocation in C# is faster than the C. Since, in C the memory need to search and allocate for the object. so it will take a bit higher time than C#. +Whenever a new object is being created. A memory is allocated in the heap and the pointer moved to next memory address. Memory allocation in C# is faster than in C since the memory needs to be searched and allocated for the object. so it will take a bit higher time than C#. #### Generations in C# GC? In .net programming, heap has three generations called generation 0, 1, 2. Generation 0 get filled first whenever new object is create. Garbage collector run when the Generation 0 get filled. newly created objects are placed in Generation 0. While performing garbage collection all the unwanted objects are destroyed, memory gets freed and compacted. GC takes care of pointing the pointers of freed memory once GC happens.