Free Space Management Flashcards

1
Q

How do we keep track of the size of blocks on a free list?

A

We give blocks a fixed size header, which will contain information about the block itself, most importantly its size. We can also use pointers in this header to help navigate the free list more easily.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Where does the free list reside?

A

Within memory itself. We keep a pointer to the first block in the free list, and then use pointers in the headers to navigate the free list.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Describe the Best Fit strategy for memory management.

A

Search the free list, and pick out the chunks of memory which is closest or bigger than the size requested. Return the smallest of these. This would require searching the entire free list though.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Describe Worst Fit strategy for memory management.

A

Find the largest free chunk, split it and return the requested size. Again, we must search the whole list, and this can still lead to fragmentation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe First Fit strategy for memory management.

A

Find the first block which is large enough, and return the requested amount. This is fast, but pollutes the beginning of the free list with small objects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Describe Next Fit strategy for memory management.

A

Instead of always looking from the start of the free list, keep a pointer to the location in the free list that we were last looking at, and start there. This spreads out searches more evenly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is a segregated free list?

A

This is where we keep multiple free lists to manage objects of particular sizes (such as 8, 16, 24 bytes…) which makes fragmentation less of a problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is buddy allocation?

A

This is where we split memory up into lots of pairs, and when one of each of the pairs is freed, we check if the other pair is free also. If they are both free, we coalesce them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What are some pros and cons of buddy allocation?

A

Pros: it is efficient for allocating frames, and for coalescing. It deals with external fragmentation well.
Cons: Not so good with dealing with internal fragmentation. A request for 9 bytes will be given 16, for example.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly