Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

CECS326 Midterm 2 Study Guide Spring 2025 California State University, Long Beach

Rating
-
Sold
-
Pages
16
Grade
A+
Uploaded on
29-05-2025
Written in
2024/2025

CECS326 Midterm 2 Study Guide Spring 2025 California State University, Long Beach/CECS326 Midterm 2 Study Guide Spring 2025 California State University, Long Beach

Institution
CECS326
Course
CECS326

Content preview

📘 CHAPTER 3: MEMORY
MANAGEMENT (Outline)

1. 💭 What is Memory Management?
●​ “Programs expand to fill the memory available to hold them” – a play on Parkinson’s
Law.​

●​ Memory is a limited resource. Even though modern computers have much more
memory than earlier ones (e.g., IBM 7094 from 1960s), we still need to manage it
wisely.​




2. ❌ No Memory Abstraction
Early computers did not have memory abstraction. "No memory abstraction" is the
simplest type of abstraction, meaning the operating system doesn’t try to hide or organize
memory in a way that simplifies or protects it for the user. In this setup, memory is
physically divided, no flexibility, protection, or multitasking capabilities.

●​ Without abstraction, memory is divided between:​

○​ Operating system (OS)​

○​ One user program​

●​ Fig 3-1 shows three ways to organize memory:​

○​ Whole memory used by OS and one user process.​

○​ Variable-sized partitions for multiple jobs: more dynamic but has external
fragmentation (need paging/compaction to fix).​

○​ Fixed-size partitions: rigid and has internal fragmentation (need
paging/segmentation to fix)​

●​ Shared Issue:
○​ Rigid: can’t adapt to different program sizes
○​ Inefficient: Wastes memory due to unused space (fragmentation).
○​ No Protection: A buggy program could overwrite OS memory

, ○​ No Multitasking: only one process runs at a time.

What Is Memory Abstraction Then?

Abstraction hides complexity from programs and users:

●​ Each program thinks it has its own private memory.​

●​ The OS manages memory using techniques like paging, segmentation, or virtual
memory.





3. Running Multiple Programs Without a Memory
Abstraction The Relocation Problem
●​ The relocation problem occurs when a program is designed to run starting at
memory address 0, but in reality, the OS loads it somewhere else in memory —
and now all its memory addresses are wrong.​

●​ Fig 3-2:​

○​ (a) 16 KB program.​

○​ (b) Another 16 KB program.​

○​ (c) When loaded together, addresses clash unless relocated.​

●​ This means the OS needs a way to relocate memory references.


🛡️ How Do We Solve It?
The OS uses relocation techniques like:

●​ Base and limit registers: Adjust the address at runtime (e.g., add base address to
all memory accesses).​

●​ Relocation during linking/loading: Rewrite addresses in the program when it’s
loaded into memory.​

●​ Virtual memory + MMU: Use address translation to automatically map virtual
addresses to correct physical addresses.



, 4. 🔒 Base and Limit Registers
●​ Protect memory with base and limit registers:​

○​ Base = starting address.​

○​ Limit = length of allowed memory.​

●​ Fig 3-3: Ensures each process stays in its lane (no illegal memory access).​




5. 🔁 Swapping (Freeing and Reusing Memory)
●​ OS swaps processes in and out of memory to make room for others.​

●​ Fig 3-4:​

○​ Shows how memory changes as processes come and go.​

○​ Shaded areas = unused (free) memory.​

●​ Fig 3-5:​

○​ (a) Allocating space for a growing data segment.​

○​ (b) Allocating for both a growing stack and data segment.​

○​ Issue: Segments may grow into each other if not planned carefully.​




6. 🧮 Allocation with Bitmaps and Linked Lists
✅ Bitmaps (Fig 3-6)
●​ Memory divided into small units.​

●​ Bitmap tracks if each unit is free (0) or used (1).​

●​ Easy to find space, but slow when memory is large.​



🔗 Linked Lists (Fig 3-7)

Written for

Institution
CECS326
Course
CECS326

Document information

Uploaded on
May 29, 2025
Number of pages
16
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$27.49
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
VEVA2K Self
Follow You need to be logged in order to follow users or courses
Sold
2860
Member since
5 year
Number of followers
2413
Documents
4446
Last sold
16 hours ago
Affordable, Up-to-date-Quality Nursing Papers

Here, you'll find a wide range of Nursing Papers at an affordable rate. Every student deserves a friendly environment for study. Always message me for any concern and help. My email is

4.1

690 reviews

5
378
4
128
3
102
2
24
1
58

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions