What is GC (Garbage Collection) and how it works



What is GC (Garbage Collection) and how it works..

Answer / kirti

One of the good features of the CLR is Garbage Collection, which runs in the background collecting unused object references, freeing us from having to ensure we always destroy them. In reality the time difference between you releasing the object instance and it being garbage collected is likely to be very small, since the GC is always running.

[The process of transitively tracing through all pointers to actively used objects in order to locate all objects that can be referenced, and then arranging to reuse any heap memory that was not found during this trace. The common language runtime garbage collector also compacts the memory that is in use to reduce the working space needed for the heap.]

Heap:

A portion of memory reserved for a program to use for the temporary storage of data structures whose existence or size cannot be determined until the program is running.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net Framework Interview Questions

mention what is code first approach and model first approach in entity framework?

0 Answers   Microsoft,


What is the CLR

1 Answers  


What is razor code?

0 Answers  


What are Action Filters in ASP.NET MVC and its use?

0 Answers  


will this code works fine? or will it gives error? Object obj=5; int i=6; i=i+obj;

9 Answers   Kanbay,


Can you handle all button click events at once in a form? Give coding.

1 Answers   Kanbay,


What is the use of web api ? Why web api needed, if you have already restful services using wcf ?

0 Answers  


Why to use '{resource}.axd/{*pathInfo}' in routing in ASP.Net MVC?

0 Answers   B-Ways TecnoSoft,


What’s the advantage of using System.Text.StringBuilder over System.String?

4 Answers   IBM,


What is the difference between string and String

1 Answers  


Will c# 3.0, vb.net 9.0, atlas, or linq be included in the .net framework 3.0?

0 Answers  


Can we create .DLL file without using the namespace?

4 Answers  


Categories