COMP 3430 – Operating Systems
Virtual Memory 2
March 28th, 2022
Copyright By PowCoder代写 加微信 powcoder
By the end of today’s lecture, you should be able to:
▶ Describe how memory is or can be organized, physically and virtually.
▶ Decide which of hardware or OS is responsible for different parts of address translation.
▶ Begin to compare and contrast methods for address translation.
The Woggle-Bug Book (Public Domain)
Managing the heap
Let’s try to experimentally determine if the OS manages the heap.
▶ Check out allocate.c.
▶ Use strace to see what system calls are
A heap. (Pixabay License)
Heap allocators
Here are some heap allocators:
1. jemalloc
2. mimalloc
3. glibcmalloc
▶ Find the interface (where is malloc?)
▶ Find where the allocator calls brk or sbrk.
▶ Anything about how the allocator manages free space.
Replacing malloc
Let’s see how we replace library code at runtime (using LD_PRELOAD).
If it quacks like a duck… (Pixabay License
Managing memory
The OS does have a responsibility to manage memory .
But maybe not quite what we originally thought.
Memories go in the brain. (Pixabay License)
Lower-level management
Memory management by the OS is at a lower level than “heaps” and “stacks”.
1. Managing physical memory allocations.
2. Translating virtual addresses to physical addresses (with the
hardware’s help )
3. Hiding implementation details of the memory from a user
process (abstraction!)
▶ Memory has a certain layout from the perspective of a process.
▶ The OS enables this layout.
▶ Hardware translates addresses.
Friday’s class
▶ No new material. ▶ Open office hours.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com