explain garbage collection in this method two


Explain Garbage collection

In this method two passes are made over the memory to identify new areas. In the first pass it traverses all pointers pointing to allocated areas and marks the memory areas which are in use. The second pass finds out all unmarked areas and declares them to be free. The garbage collection overheads are not incremental. They are acquired every time the system runs out of free memory to allocate to new requests.  
Two major approaches to reuse free memory area in a heap are:

First-fit:  Allocate the first hole which is big enough. Searching can start either at the starting of the set of holes or where the previous first-fit search ended. Searching is stopped when a free hole is found that is large enough

Best-fit:  Allocate the smallest hole which is big enough; whole list is searched, unless ordered by size.  This strategy generates the smallest leftover hole.   

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: explain garbage collection in this method two
Reference No:- TGS0283598

Expected delivery within 24 Hours