Java system threads automatically handle garbage collection.
Garbage collection can not be forced.
Suggesting Java virtual machine to expend effort toward recycling unused objects in order to make the memory they currently occupy available for quick reuse:
java.lang.System.gc();
java.lang.Runtime.gc();
Garbage collection can not be forced.
Suggesting Java virtual machine to expend effort toward recycling unused objects in order to make the memory they currently occupy available for quick reuse:
java.lang.System.gc();
java.lang.Runtime.gc();