GC in dot net

GC in dot net

1. GC is background thread of any .net application. It has low priority but when it comes to picture it gets real time priority.

2. When we create an object using new keyword, CLR first calculate the amount of memory required for that object.

3. There exists 3 Generation.

4. Generation 0,1 and 2.

5. After calculating the memory required for new object, CLR allocates the object next to previous object in memory.

6. If there doesn't exists enough space in generation 0, GC starts collecting the objects whose references are not found.

7. after collecting the objects it stats compacting the memory.

8. If it still not get enough space, it moves all Generation 0 objects to Generation 1.

9. New object gets created on Generation 0.

10. If there doesn't exists enough space at Generation 1, same process occurs in generation 1 and moves objects to Generation 2.

11. If there doesn't exists enough memory, it throws Memory exception.

This is micro blog.




GC in dot netASP net Write Text On Image C#.net and Vb.net programAsp.net delete file file on Server C#.net and VB.net codeRemove internet explorerAsp.net Interview Questions for 2 years or 3 years experianceASp.net 2.0 step by step Membership Provider One dimensional array example C#.net VB.netC# foreach loopHow to select multiple columns in Linq- C#.net VB.net codeRead Text File in (C#.net or VB.net)How are you using session variables in Asp.net with C#.net


My name is Satalaj, but people call me Sat. Here is my homepage: . I live in Pune, PN and work as a Software Engineer. I'm former MVP in ASP.net year 2010.
Disclaimer: Views or opinion expressed here are my personal research and it has nothing to do with my employer. You are free to use the code, ideas/hints in your projects. However, you should not copy and paste my original content to other web sites. Feel free to copy or extend the code.
If you want to fight with me, this website is not for you.

I'm Satalaj.