79506179

Date: 2025-03-13 10:42:05
Score: 1.5
Natty:
Report link

Garbage Collector in Java is also called Automatic Memoty Management. In simple words, it's used to free the heap memory. It works on objects that are no longer references.

Request Garbage Collector (GC) Methods:

  1. System.gc(); -> Request GC to run

  2. Runtime.getRuntime().gc(); -> Way to request GC

Ways to make Object eligible for GC

Reasons:
  • No code block (0.5):
  • Low reputation (1):
Posted by: Suraj Patil