* Garbage Collection help us to free memory from unused objects.
* Garbage Collection is a Deamon Thread which run behind the application , and this thread is started by JVM itself.
* The Garbage Collection can not be forced, though there are few ways by which it can be requested there is no guarantee that these requests will be taken care by JVM.
* In Java There are Two ways to call Garbage Collection , gc() method of Garbage Collection belongs to java.lang package.
1 ) System.gc();
2 ) Runtime.getRuntime().gc();

No comments:
Post a Comment