Which method is used to explicitly request garbage collection in Java?

Last Updated :
Discuss
Comments

Which method is used to explicitly request garbage collection in Java?


System.gc()

Runtime.gc()

GarbageCollector.run()

MemoryManager.cleanup()

Share your thoughts in the comments