Monday, November 1, 2010

Reference Count in Garbage Collection

What is Reference Count ?
Ans
As a garbage collection algorithm, reference counting tracks for each object 
a count of the number of references to it held by other objects. If an object's
reference count reaches zero, the object has become inaccessible, and
 can be destroyed.


Advantages : 
In real-time applications or systems with limited memory,Programs cannot
 be interrupted. 
Disadvantages : 
1) Reference counting requires every memory-managed object to reserve
 space for  a reference count.
2) The naive algorithm described above can't handle reference cycles, an 
object which refers directly or indirectly to itself.

No comments:

AWS certification question

AWS AWS Hi! this is for questions related to AWS questions. EC2 instances EC2 storage types cold HDD : 1. Defines performance in terms...