What is garbage collection in Java, and how can it be used ?

Answer Posted / poonam

In computer science, garbage collection (GC) is a form of automatic memory management. The garbage collector, or just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use by the program. Garbage collection was invented by John McCarthy around 1959 to solve problems in Lisp.[1][2]
Garbage collection is often portrayed as the opposite of manual memory management, which requires the programmer to specify which objects to deallocate and return to the memory system. However, many systems use a combination of the two approaches, and other techniques such as stack allocation and region inference can carve off parts of the problem. There is an ambiguity of terms, as theory often uses the terms manual garbage collection and automatic garbage collection rather than manual memory management and garbage collection, and does not restrict garbage collection to memory management, rather considering that any logical or physical resource may be garbage collected.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a subsequence of a string?

549


What is derived datatype?

631


how to open and edit XML file in Weblogic???

1551


Why we use protected in java?

536


Which class is the superclass for every class in java programming?

573






What is difference between array and vector?

535


What is canonical name in java?

622


What does localhost mean?

500


What is hash in java?

523


Given a singly linked list, determine whether it contains a loop or not without using temporary space?

582


What is the full form of jpeg?

523


How strings are created in java?

568


In java how do we copy objects?

553


What are internal and external variables?

546


What is the purpose of the finally clause of a try-catch-finally statement in java programming?

511