Garbage Collection in Java | How it works - Developer Helps
SOLVED: When should you call System.gc()? Under rare circumstances, Java automatically calls garbage collection whenever any variable goes out of scope. After declaring a class, and when your code approaches the memory