Gubbas Digi Communications

Gubbas Digi Communications

Garbage Collector




Program to perform garbage collector

import java.util.*;
class Garbage
{
public static void main(String[] args)
{
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 collector "+rs.freeMemory());
}
}

No comments:

Post a Comment