Name and explain the popular techniques to identify free memory areas as a result of allocation and de-allocations in a heap.
Two well-liked techniques to identify free memory areas like a result of allocation and de-allocations in a heap are as:
1. Reference count: the system relates a reference count with each memory area to show the number of its active users. This number is incremented while a user accesses such area and decrements while user stops using it. The region is free if the reference counts drops to zero. Such scheme is very simple to implement although incurs incremental overheads.
2. Garbage collection: In such technique two passes are done over the memory to identify unused areas. Into the first pass this traverses all pointers pointing to assigned areas and marks the memory areas which are in use. The second pass determines all unmarked areas and declares them to be free. Its overheads are not incremental. They are incurred all time the system runs-out of free memory to assign to fresh requests.