




























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























class22.ppt
free block pred succ free block pred succ Before: After: (with splitting)
Insert freed block at the beginning of the free list Pro: simple and constant time Con: studies suggest fragmentation is worse than address ordered.
Insert freed blocks so that free list blocks are always in address order » i.e. addr(pred) < addr(curr) < addr(succ) Con: requires search Pro: studies suggest fragmentation is better than LIFO
Splice out prev, coalesce with self, and add to beginning of free list
Splice out prev and next, coalesce with self, and add to beginning of list p s f self a
p s f a
p1 s f self f
f
p2 s p1 s1 p2 s
If free list for size n is not empty,
If free list is empty,
Constant time
Add to free list If page is empty, return the page for use by another size (optional)
Fast, but can fragment badly
Each block is a node in the graph Each pointer is an edge in the graph Locations not in the heap that contain pointers into the heap are called root nodes (e.g. registers, locations on the stack, global variables)
A node (block) is A node (block) is reachable if there is a path from any root to that node.if there is a path from any root to that node. Non-reachable nodes are Non-reachable nodes are garbage garbage (never needed by the application)(never needed by the application)
Mark using depth-first traversal of the memory graph Sweep using lengths to find next block