C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
Java
Learn iOS Programming
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
3
Reply
How does Garbage collector locate Garbage?
Guest User
11y
2.1k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
There are three generations. Gen0, Gen1, Gen2 Whenever objects are created they are kept into Gen0 bucket. Garbage collector visits to Gen0 quite frequently. if any objects are are not referencing to any anybody, in other terms if it is assigned to null, then this object is moved to garbage collection queue from there the object is removed.longer the object resides into Gen0 its is subsequently moved to Gen1 and then Gen2 buckets.
sarang Chandaikar
11y
1
Garbage Collection is a memory management and automatically recycling the heap memory. The collector recycles the memory that is not referencing and that can prove will never be used again. By collector it is assumed that when something is no longer needed, it is no longer referenced. This can be detected and the widget collected. Reference Counting: each object contains a counter saying how many references to it there are. When you refer to an object, you increment the counter. When you're done with it, you decrement the counter. When the counter reaches 0, the object can be recycled.Stop And Copy: The heap is divided into two regions. One contains objects, and the other is empty. You recursively traverse all the objects in the first region (as in mark-and-sweep), copying them into the second region. Then you interchange the roles of the two regions. No need to scan the unused objects in the first region.
Raghav Mehra
11y
0
By using WeekReference Object it will find out the unused object and it will clear.
lv prasad
11y
0
nullable types example
What is MultiDictionary?
Message