Operating systemsLesson 1 of 1 in the course Memory management

Memory Management: Allocation Strategies, Reclamation, and Virtual Memory

5 flashcards · 5 quiz questions · 5 match pairs · 5 fill-in sentences · English

Lesson progress
0 / 5

Your progress is kept in this browser only.Sign up to save it

Summary

Memory management gives programs access to the memory they need and makes that memory available for reuse when it is no longer needed. This lesson introduces the purpose of memory management and the fundamentals of manual allocation.

Memory management is the management of computer memory as a resource. Programs often cannot know in advance exactly how much memory they will need, or how long they will need it. A memory manager therefore provides ways to allocate memory on request and return it for reuse later.

All flashcards

What is memory management?
It is the process of allocating memory to programs as needed, tracking its use, and making it available for reuse when it is no longer needed.
What are the heap and free store?
They are names for a pool of memory used to satisfy dynamic allocation requests. The pool contains both allocated blocks and unused portions.
What do malloc and free do in C?
`malloc` requests a block of heap memory. `free` marks a previously allocated block as available for reuse.
What is external fragmentation?
It occurs when unused memory is divided into separated small gaps. Even if those gaps add up to enough total memory, no single gap may satisfy a large contiguous request.
What is a memory leak?
A memory leak occurs when allocated memory is no longer useful but is not released, preventing the memory manager from reusing it.

Quiz questions

  1. When can a buddy allocator merge a freed block with another block?Answer: When its matching buddy is also free.
  2. How does slab allocation organize memory for repeated allocations of similar objects?Answer: It keeps caches of slots for objects of particular types or sizes.
  3. Why can reference counting fail to reclaim objects in a circular reference?Answer: The objects can keep one another's reference counts above zero.
  4. What does virtual-memory translation do when a process uses a virtual address?Answer: It maps the virtual address to a physical address.
  5. In Burroughs/Unisys MCP, what does a segment descriptor's p-bit indicate?Answer: Whether the segment is in main memory or must be loaded.

Based on the Wikipedia article Memory management, licensed CC BY-SA 4.0. Adapted into a summary, flashcards and quizzes.

All Operating systems lessons