RD20: Memory Allocation I

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/26

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

27 Terms

1
New cards

How many types of allocators are there?

2 allocators: An implicit allocator and an explicit allocator

2
New cards

What is an implicit allocator?

Where the programmer is only responsible for allocations, and the allocator implicitly handles the deallocations.

3
New cards

What is an explicit allocator?

Where the programmer is responsible for both allocations and deallocations.

4
New cards

What is the first thing the application must adhere to to follow the interface contract?

Can issue an arbitrary sequence of allocation and deallocation.

5
New cards

What is the second thing the application must adhere to to follow the interface contract?

Must never access memory that is not currently allocated.

6
New cards

What is the third thing the application must adhere to to follow the interface contract?

Must never try to deallocate memory that is not currently allocated.

7
New cards

What is the first thing the allocators must adhere to to follow the interface contract?

Can't control the number or size of allocated blocks.

8
New cards

What is the second thing the allocators must adhere to to follow the interface contract?

Must respond immediately to allocation requests.

9
New cards

What is the third thing the allocators must adhere to to follow the interface contract?

Must satisfy alignment requirements during allocation.

10
New cards

What is the fourth thing the allocators must adhere to to follow the interface contract?

Can only allocate from freed memory.

11
New cards

What is the fifth thing the allocators must adhere to to follow the interface contract?

Can't move allocated blocks.

12
New cards

What are the two dynamic memory allocator performance goals that frequently conflict with each other?

1. Throughput

2. Memory Utilization

13
New cards

What is Throughput as a performance goal?

The allocator wants to complete as many allocation and dealllocation requests as possible per unit time.

14
New cards

What is Memory Utilization as a performance goal?

Using the heap space as efficiently as possible.

15
New cards

What is an implicit free list?

An allocator implementation that traverses its blocks via arithmetic by using the size of each block.

16
New cards

What is an explicit free list?

An allocator implementation that traverses its free blocks using a linked list data structure.

17
New cards

What causes poor memory utilization?

Fragmentation: all the parts of the heap that are not currently being used to store program data.

18
New cards

What is internal fragmentation?

The "wasted" space inside of allocated heap blocks.

19
New cards

What is external fragmentation?

The unused space between allocated heap blocks.

20
New cards

What must the dynamic memory allocator do to manage the heap?

The allocator must always allocate a block sizze that is greater than the requested space.

21
New cards

What is the payload?

The requested space, space requested by the allocator.

<p>The requested space, space requested by the allocator.</p>
22
New cards

What is internal fragmentation in relation to the payload?

All of the space within a block that is NOT the payload.

23
New cards

What are the sources of internal fragmentation?

Heap data structures and alignment padding.

24
New cards

What does external fragmentation consist of?

All the holes between allocated blocks.

25
New cards

What’s the cause of external fragmentation?

The specific pattern of allocation/deallocation requests.

26
New cards

What’s a potential problem with allocation/deallocation requests?

Sometimes an allocation request cannot be satisfied despite there being enough total free heap memory.

27
New cards

An example of allocation/deallocation request issues.

knowt flashcard image