I read many things about garbage collection like it's generation, scope etc but want to know when does the garbage collection gets triggered ? an example will be really helpful if possible.
Thanks,
See Question&Answers more detail:osI read many things about garbage collection like it's generation, scope etc but want to know when does the garbage collection gets triggered ? an example will be really helpful if possible.
Thanks,
See Question&Answers more detail:osGarbage collection occurs when one of the following conditions is true:
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.