We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5d7d8d3 commit 78f7eaaCopy full SHA for 78f7eaa
GarbageCollection.java
@@ -0,0 +1,13 @@
1
+// Program to Demonstrate Garbage Collection
2
+
3
+import java.util.*;
4
+class GarbageCollection
5
+{
6
+ public static void main(String args[]) throws Exception
7
+ {
8
+ Runtime rs = Runtime.getRuntime();
9
+ System.out.println("Free Memory in JVM before Garbage Collection :- "+rs.freeMemory());
10
+ rs.gc();
11
+ System.out.println("Free Memory in JVM after Garbage Collection :- "+rs.freeMemory());
12
+ }
13
+}
0 commit comments