Java has an automatic garbage collection mechanism.
Tips
usage
Dual meaning: in programming it's the runtime reclaiming unused memory; in daily life it's literal waste recycling. Developers often abbreviate to 'GC'.
memory
垃圾 (garbage) + 回收 (recycle/reclaim) - both the physical and programming senses share the same literal logic.