Methods to invoke garbage collector explicitly
Methods to invoke garbage collector explicitly
There are two ways to make a request to Java Virtual Machine in order to execute garbage collector explicitly:
Using System Class
This class support rich methods that deals with standard input and output, loading files and libraries and so on. It falls under Java.lang package. It also provides a method named gc() to request JVM to make an effort to run a garbage collector. Syntax:
System.gc();
Sin…
View On WordPress
















