Is it possible to force garbage collection in Java, even if it is tricky to do? I know about System.gc();
and Runtime.gc();
but they only suggest t
It would be better if you would describe the reason why you need garbage collection. If you are using SWT, you can dispose resources such as Image
and Font
to free memory. For instance:
Image img = new Image(Display.getDefault(), 16, 16);
img.dispose();
There are also tools to determine undisposed resources.