Answer Posted / stanly jose
Ofcourse, Garbage Collection is done for the memory
utilization (making use of memory space which is allocated
to the unused objects).
And this Garbage Collection is autometically done by the
CLR. Still we can also implicity for the CLR to collect the
unused memory allocated to unused objects. But that is not
at all necessary.
When a program is loaded into memory, it is organized into
three areas of memory, called segments: the text segment,
stack segment, and heap segment.
So the compiled code will reside in the text segment.
the variables like string, int ect..(value types) will
reside in stack segment.
the objects like class(reference type) will reside in the
heap segment.
So when a new object is created the Garbage Collector will
look unused objects and it will free them from the heap. so
that the new object can reuse the memory allocated to the
unused object.
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
Can you see a loop recorder?
Explain About Virtual functions and their use.
What are the different types of assembly?
What is the difference between const and readonly in c#.net?
What are custom exceptions? Why do we need them?
What is cts, clr?
Can an int be negative c#?
What does async mean in c#?
What is the use of GC.KeepAlive Method?
How many types of collections are there in c#?
What is hierarchical inheritance in c#?
Explain About .NET Framework
What is the use of ispostback in c#?
How to find methods of a assembly file (not using ILDASM)?
Illustrate race condition?