Garbage Collector
When does garbage collector start to run in c#?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sujeet SumanRank #790 · 2.9K reputationPosted Jun 19, 2015, 4:39 AM EDT
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Jun 19, 2015, 5:59 PM EDT
Munesh SharmaRank #174 · 13.9K reputationPosted Jun 19, 2015, 10:14 PM EDT
Vignesh ManiRank #98 · 22.1K reputationPosted Jun 25, 2015, 1:44 AM EDT
1. The system has low physical memory.
2. The memory that is used by allocated objects on the managed heap surpasses an acceptable threshold. This threshold is continuously adjusted as the process runs.
3. The GC.Collect method is called. In almost all cases, you do not have to call this method, because the garbage collector runs continuously. This method is primarily used for unique situations and testing.