Unit3(OS) - WordPress.com

advertisement
UNIT 3-TWO MARKS
1. Define paging.
 Paging is a memory management scheme that permits the physical address space of a
process to be noncontiguous.
 Paging reduces external fragmentation.
 In paging physical memory is divided into fixed sized blocks called frames and physical
memory is divided into fixed sized blocks called pages.
2. Define thrashing. Give an example. How do you limit the effects of thrashing?
 Thrashing is a high paging activity where the system would be mostly busy in performing
paging (page-out, page-in) rather than executing the processes.
 Diagram
 Working set model is an approach used to prevent thrashing; it is based on the
assumption of locality.
3. Give the pictorial representation of storage hierarchy.
4. Advantages of virtual memory management system
Virtual memory allows execution of partially loaded processes.
Benefits:
 The primary advantage or objective of Virtual Memory systems is the ability to load and
execute a process that requires a larger amount of memory than what is available by
loading the process in parts and then executing them.
 Less number of I/O would be needed to load or swap each user program into memory
UNIT 3-TWO MARKS
 A program would no longer be constrained by the amount of physical memory available
 Each user program could take less physical memory, more programs could run at same
time, with corresponding increase in CPU utilization and throughput.
5. What is an overlay? What is the use of it?
 Overlaying is a memory management technique that allows a process to execute
irrespective of the system having insufficient physical memory.
 The programmer splits the program into smaller parts called overlays in such a way that
no overlays are required to be in main memory at same time.
 An overlay is loaded into memory only when it is needed.
6. What is demand paging?
 Virtual memory can be implemented by demand paging.
 In demand paging, a page is loaded into memory only when it is needed during program
execution.
 Pages that are never accessed are never loaded into the memory.
7. Difference between demand paging and swapping
Demand Paging
Swapping
In demand paging, a page is loaded into The process of bringing a process into memory
memory only when it is needed during and after running for a while, temporarily
program execution.
copying it to disk is known as swapping.
Used to implement virtual memory.
In multiprogramming, swapping is used to
increase CPU Utilization.
8. What is spatial locality of reference?
 It refers to the fact that if a memory location is accessed, it is likely that a location near
it will be accessed in the next instruction.
 For example, access to variables within a program results in spatial locality.
9. Write about partition memory management.
 One of the simplest ways to manage memory is to partition the main memory into two
parts: One for OS and other allocated to user process.
 Multiprogramming, memory is divided into a number of partitions which may be fixed
or variable size.
10. What is the advantage of demand paging?
 Only loads pages that are demanded by the executing process.
 Large virtual memory.
UNIT 3-TWO MARKS
 More efficient use of memory.
 Unconstrained multiprogramming. There is no limit on degree of multiprogramming.
11. Differentiate a page from a segment.
Page
Segment
In paging logical memory is divided into fixed- In segmentation, the entire logical address
size blocks called pages which are of same size space is considered as a collection of
as page frames.
segments.
Each page contains a <page no, offset>
Each segment contains a <segment no, offset>
12. Define TLB.
 Problem with paging is that extra memory references to access translation tables can
slow programs down by a factor of two or three.
 Too many entries in translation tables to keep them all loaded in fast processor
memory.
 The standard solution to this problem is to use small fat lookup hardware called
Translation Look-aside buffer.
 TLB is associative and high speed memory(store a few translation table entries).
13. Internal and external fragmentation. How external fragmentation can be solved?
Internal Fragmentation
External Fragmentation
Memory allocated to a process may be slightly
larger than the requested memory. The
difference between these two numbers is
internal fragmentation.
External Fragmentation exists when there is
enough total memory space to satisfy a
request but available spaces are not
contiguous.
First fit and best fit memory allocation does First fit and best fit memory allocation suffer
not suffer from internal fragmentation.
from external fragmentation.
Single partition scheme and paging suffer from Multiple partition scheme and segmentation
internal fragmentation.
suffer from internal fragmentation.
 One technique to overcome external fragmentation is compaction.
14. What is address binding?
When a user program is brought into main memory for execution, its logical addresses must be
mapped to physical addresses. The mapping from addresses associated with a program to
memory addresses is known as address binding.
15. Page fault
A page fault (sometimes called #pf or pf) is a type of interrupt, called trap, raised by the
hardware when a running program accesses a memory page that is mapped into the virtual
address space, but not loaded in physical memory.
UNIT 3-TWO MARKS
16. Page frame.
In paging, the physical memory is divided into fixed-sized blocks called page frames.
17. Problem: if a computer system has 16 bit address line and supports 1K page size what will be
the max page no supported by the system?
Solution: computer system has 16 bit address line => logical address is of 16 bits.
Therefore size of logical address space is 216 and page size is 1K => 1 * 1024 bytes = 210 bytes.
Thus the page offset is 10 bits and page number will be (16-10) = 6 bits.
Therefore, the max page no supported by system is 111111.
18. Logical & physical address
An address generated by the CPU is a logical address whereas address actually available on
memory unit is a physical address. Logical address is also known a Virtual address.
19. MMU
Memory management unit (MMU) is a hardware device which is responsible for mapping the
virtual address to physical address at run time.
20. Segmentation.
 Segmentation is a memory management scheme.
 It divides a program into a number of smaller blocks called segments.
 A segment can be defined as a logical grouping of information such as subroutine, array
or data area.
Download