What is garbage collection?

Showing Answers 1 - 1 of 1 Answers

Ashok Jose

  • Aug 13th, 2006
 

Garbage Collection is the way Java cleans up memory not in use. In languages such as C, C++ the user has to do the memory handling, ie, he creates some data structure and he may allocate some memory for that through the malloc command and when he no longer needs the data structure he may need to free up that memory throught the free command, unlike this, in Java all these will be handled by java itself, user need not bother when to free up memory etc, there are various strategies by which the Java frees up memory when needed, this is getting improved more and more with better algorithms. This is done to free up the user from knowing all the difficultirs in memory handling, which is supposed to be highly critical and error prone, hence Java has the advantage with respect to C, C++ and hence popular.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions