what is garbage collection?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / ganni
garbage collection is the process of clearing the memory of
unused objects, which will be taken care by CLR on
periodical basis.
Is This Answer Correct ? | 4 Yes | 0 No |
Answer / thirushakar
It is use to free the memory of the object r method in use.
Is This Answer Correct ? | 3 Yes | 0 No |
Answer / kalidoss
Actually the new operater is used to allocate the memory to
an object that object not needed for longtime,so that
objects are thrown away or release from the memory by the
garbage collector.
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / jiten
it is clr function
it is use to release those objext whitc is not longer useor
no longer refeances in application
it is System.GC.Collaction
Is This Answer Correct ? | 1 Yes | 1 No |
GARBAGE COLLECTER IS NOTHING BUT,USING GARBAGE COLLECTOR FREE THE WASTE MEMORY.GARBAGE COLLECTOR IS UNDER THE CLR.IT IS MANAGING THE MEMORY
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / kirti
Garbage collection is a system whereby a run-time component takes responsibility for managing the lifetime of objects and the heap memory that they occupy. This concept is not new to .NET - Java and many other languages/runtimes have used garbage collection for some time.
Is This Answer Correct ? | 0 Yes | 0 No |
What is the execution entry point for a c# console application?
How does yield return work c#?
Is inheritance possible in c sharp?
Why are mutable structs evil?
What is the difference between const and readonly in c#.net?
What are the variables in c#?
What is the benefit of interface in c#?
What is the boxing and unboxing in c#?
What is service contract
Is there any way to access private memebers of an object from another object?
Define multicast delegate in c#?
What is dataview c#?