System.gc();
But we can't predict at what time it'll run even if you force it to run.
GC runs once a while and you can make objects eligible to dispose by using several methods.
- Unregister all listeners
- Stop all timers and intervals
- Stop playheads like sounds,videos.
- Deactivate objects that would become unreachable if the object itself became unreachable. (nullify)