The abstraction: Address Spaces Flashcards
What does switching between processes when the running issues an I/O?
Increase the effective utilization of the CPU
What is the address space
Easy to use abstraction of physical memory which OS does.
What does the program use the stack for?
Keep track of where it is in the function call chain as to allocate local variables and pass parameters and return values to and from routines.
Why are heap at the top and stack at the bootom of address space?
Allows for free growth of both of them.
When the running program think it is loaded into memory at a particular address and has a potentially very large address space
OS is virtualizing memory
OS should implement virtual memory in a way that is invisible to the running program (program not aware of its memory is virtualized). This is called:
Transparancy
In implementing time-efficient virtualization the os will have to rely on what?
Hardware support (including features such as TLB).
When one process performs a load, a store or an instruction fetch it should not be able to access or affect in any way the memory contents of any other process or the OS itself. It also called:
Protection
What does protection enables ur to deliver among processes?
Isolation
What is Virtual memory system responsible for providing?
Illusion of a large, sparse, private address space to program, which hold all of their instructions and data therein.
Who/what manages allocations and deallocations of stack memory?
The compiler
When is memory deallocated from the stack?
Whn program returns from a function.
Who/what manages allocations and deallocation of heap memory?
The programmer
Explain malloc()
You pass it a size asking for some room on the heap, and it either succeeds and give you back a pointer to the newly-allocated space, or fails and returns NULL. It is a library call, build on top of some system calls which call into the OS to ask for more memory or release some back to system.
What is a compile-time operator?
The actual size is known at compile time
What is returned by malloc()
A void pointer that can be casted into another datastructure (not needed).
Who/what tracks the size of an allocated region on the heap?
Memory-allocation library itself.
If a program compiled or it ran it is correct. TRUE OR FALSE?
False