What is the use of garbage collection in Java? By Admin on The purpose of garbage collection is to identify and discard objects that are no longer needed by a program so that their resources can be reclaimed and reused.