In a reference count method of garbage collection, each cell c has a counter field whose value indicates how many other cells refer (point) to it. The counter is incremented every time another cell refers to c and decremented if a reference is deleted. The garbage collector uses this counter when sweeping the heap: If a cell’s count is zero, the cell can be reclaimed because it is not pointed to by any other cell. Discuss the advantages and disadvantages of this garbage collection method.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here