No, you don't have an option to force garbage collection. The only closest thing we have in Java is System.gc()
which intimates or requests the JVM to collect garbage. By which JVM most of the time does GC after the call, sometimes it postpones based on the resource utilization, etc., sometimes it doesn't.
Summary: use System.gc()