Garbage Collection is automatic behavior by the JVM that finds all unreachable (unused) allocated memory locations and automatically frees up the memory. The JVM keeps a reference count of all reference variables that are currently referring to an object. If the reference count is 0, the object is considered an unreachable object that is eligible for garbage collection, as variables in the program refer to the object.
Programmers don’t have to set a reference variable to null in order for it no longer reference an object and be garbage collected. The JVM can automatically infer a null reference once the variable goes out of scope (no longer visible to the program)
Download
0 formats
No download links available.
Basic Java Garbage Collection by the JVM - Free up Memory in your Program Automatically - APPFICIAL | NatokHD