You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12 lines
378 B
Java
12 lines
378 B
Java
import java.util.*;
|
|
|
|
class GarbageCollection
|
|
{
|
|
public static void main(String s[]) throws Exception
|
|
{
|
|
Runtime rs = Runtime.getRuntime();
|
|
System.out.println("Free memory in JVM before Garbage Collection = "+rs.freeMemory());
|
|
rs.gc();
|
|
System.out.println("Free memory in JVM after Garbage Collection = "+rs.freeMemory());
|
|
}
|
|
} |