Made several grammatical changes (#23359)

Changed " are happened in managed heap. which takes care" to "happens in managed heap, which is taken cared of" and  "where ever" to "wherever" on line 15 to make grammatical sense. 
 Modified "than the C. Since, in C the memory need" to " in C since the memory needs to be searched and allocated".
This commit is contained in:
SoMike
2018-11-25 13:30:47 +02:00
committed by Huyen Nguyen
parent 6619c0bf00
commit c847846d66

View File

@ -14,7 +14,7 @@ As said above, every programming language has their own way of GC. In C programm
#### How memory allocation happening? #### 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. 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? #### 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. 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.