The Garbage Collector and Destructor are intrinsically linked - However , most objects do not have a destructor . If an object have the destructor , the garbage collector invokes it around the same time as collection . Garbage collection is non-deterministic . it happens when it happens .
Garbage collector is used to just check whether any dis passing of object is required , and if any it will call the destructor , Garbage Collector cannot destroy anything on its own . and Destructor on other hand will destroy the object at end of class , and destructor cannot check for the memory issues . it just destroy everything at the end .
Garbage collector is used to just check whether any dis passing of object is required , and if any it will call the destructor , Garbage Collector cannot destroy anything on its own . and Destructor on other hand will destroy the object at end of class , and destructor cannot check for the memory issues . it just destroy everything at the end .
No comments:
Post a Comment