- Java provides automatic Garbage Collection.
- Garbage collector will be executed automatically when the heap is almost full.
- On demand we can run the Garbage Collector by calling gc() method.
Code: Runtime.getRuntime().gc();
No comments:
Post a Comment