CSE 120 Lecture Notes - Lecture 8: Binary Tree, Fits, Context Switch

33 views4 pages
Process Memory
Text Area: physical code of program
Data: static vars, heap
Stack: automatic vars, activation records (stack frames)
Other: “shared” memory regions
- Size, fixed or variable
- Permissions: r, w, x (Read, Write, Execute)
Process’s Memory Address Space
-Note: process ACTS as if it “owns” the whole memory (it doesn’t FYI)
Address Space
- Set of addresses to access memory
- Linear and sequential
- 0 to N-1 (where N is the size of your memory)
Text (of size X): 0 - (X-1)
Data (of size Y): X - (X+Y-1)
Stack: (of size Z): N-Z to N-1
Compiler’s Model of Memory
-compiler generates memory addresses
-allow stack and data to grow
-what does the compiler NOT know?
- physical memory size
- allocated regions of physical memory (to avoid)
Multiple Processes: CPU + Memory
In reality: ONE CPU divided up for each process, and ONE memory divided up for each process
-each subdivison of each process contains its own Text, Data, Stack regions
Sharing Physical Memory
- Processes moving in and out take so much time!
Solution: keep multiple processes in memory
-context switch ONLY between processes in memory
Memory Management
-Physical memory starts as one “empty hole”
-over time, areas are allocated
-to allocate:
1. Find large enough hole
2. Allocate region within hole
Unlock document

This preview shows page 1 of the document.
Unlock all 4 pages and 3 million more documents.

Already have an account? Log in

Get OneClass Notes+

Unlimited access to class notes and textbook notes.

YearlyBest Value
75% OFF
$8 USD/m
$30 USD/m
You will be charged $96 USD upfront and auto renewed at the end of each cycle. You may cancel anytime under Payment Settings. For more information, see our Terms and Privacy.
Payments are encrypted using 256-bit SSL. Powered by Stripe.