Junior — Middle
At what point in memory management does automatic cleanup of unused objects occur?
sobes.tech AI
Answer from AI
Automatic cleanup of unused objects in C# occurs during the garbage collection process (Garbage Collector, GC). It is triggered when the system determines that available memory is running out or when the application is idle. The garbage collector analyzes objects in the managed heap and removes those that are no longer referenced, freeing memory automatically without programmer intervention.