To obtain better memory-space
utilization dynamic loading is used. With dynamic loading, a routine is not
loaded until it is called. All routines are kept on disk in a relocatable load
format. The main program is loaded into memory and executed. If the routine
needs another routine, the calling routine checks whether the routine has been
loaded. If not, the relocatable linking loader is called to load the desired
program into memory.
2. Define Dynamic Linking.
Dynamic linking is similar to
dynamic loading, rather that loading being postponed until execution time,
linking is postponed. This feature is usually used with system libraries, such
as language subroutine libraries. A stub is included in the image for each
library-routine reference. The stub is a small piece of code that indicates how
to locate the appropriate memory-resident library routine, or how to load the
library if the routine is not already present.
3. What are Overlays?
To enable a process to be larger
than the amount of memory allocated to it, overlays are used. The idea of
overlays is to keep in memory only those instructions and data that are needed
at a given time. When other instructions are needed, they are loaded into space
occupied previously by instructions that are no longer needed.
4. Define Swapping.
A process needs to be in memory
to be executed. However a process can be swapped temporarily out of memory to a
backing store and then brought back into memory for continued execution. This
process is called swapping.
5. What do you mean by Best Fit?
Best fit allocates the smallest
hole that is big enough. The entire list has to be searched, unless it is
sorted by size. This strategy produces the smallest leftover hole.
6. What do you mean by First Fit?
First fit allocates the first
hole that is big enough. Searching can either start at the beginning of the set
of holes or where the previous first-fit search ended. Searching can be stopped
as soon as a free hole that is big enough is found.
7. How is memory protected in a paged environment?
Protection bits that are
associated with each frame accomplish memory protection in a paged environment.
The protection bits can be checked to verify that no writes are being made to a
8. What is External Fragmentation?
External fragmentation exists
when enough total memory space exists to satisfy a request, but it is not
contiguous; storage is fragmented into a large number of small holes.
9. What is Internal Fragmentation?
When the allocated memory may be slightly
larger than the requested memory, the difference between these two numbers is
10. What do you mean by Compaction?
Compaction is a solution to
external fragmentation. The memory contents are shuffled to place all free memory
together in one large block. It is possible only if relocation is dynamic, and
is done at execution time.
11. What are Pages and Frames?
Paging is a memory management
scheme that permits the physical-address space of a process to be
non-contiguous. In the case of paging, physical memory is broken into
fixed-sized blocks called frames and logical memory is broken into blocks of
the same size called pages.
12. What is the use of Valid-Invalid Bits in
bit is set to valid, this value indicates that the associated page is in the
logical address space, and is
thus a legal page. If the bit is said to invalid, this value indicates that the
page is not in the process’s logical address space.
Using the valid-invalid bit traps illegal
13. What is the basic method of Segmentation?
Segmentation is a memory
management scheme that supports the user view of memory. A logical address
space is a collection of segments. The logical address consists of segment
number and offset. If the offset is legal, it is added to the segment base to
produce the address in physical memory of the desired byte.
14. A Program containing
relocatable code was created, assuming it would be loaded at address 0. In its
code, the program refers to the following addresses: 50,78,150,152,154. If the
program is loaded into memory starting at location 250, how do those addresses
have to be adjusted?
All addresses need to be adjusted
upward by 250.So the adjusted addresses would be 300, 328, 400, 402, and 404.
15. What is Virtual Memory?
Virtual memory is a technique
that allows the execution of processes that may not be completely in memory. It
is the separation of user logical memory from physical memory. This separation
provides an extremely large virtual memory, when only a smaller physical memory
16. What is Demand Paging?
Virtual memory is commonly
implemented by demand paging. In demand paging, the pager brings only those
necessary pages into memory instead of swapping in a whole process. Thus it
avoids reading into memory pages that will not be used anyway, decreasing the
swap time and the amount of physical memory needed.
17. Define Lazy Swapper.
Rather than swapping the entire
process into main memory, a lazy swapper is used. A lazy swapper never swaps a
page into memory unless that page will be needed.
18. What is a Pure Demand Paging?
When starting execution of a
process with no pages in memory, the operating system sets the instruction
pointer to the first instruction of the process, which is on a non-memory
resident page, the process immediately faults for the page. After this page is
brought into memory, the process continues to execute, faulting as necessary
until every page that it needs is in memory. At that point, it can execute with
no more faults. This schema is pure demand paging.
19. Define Effective Access Time.
Let p be the probability of a
page fault (0£p£1). The value of p is expected to be close to 0; that is, there
will be only a few page faults. The effective access time is,
access time = (1-p) * ma + p * page fault time.
20. Define Secondary Memory.
This memory holds those pages
that are not present in main memory. The secondary memory is usually a high
speed disk. It is known as the swap device, and the section of the disk used
for this purpose is known as swap space.
21. What is the basic approach of Page
If no frame is free is available,
find one that is not currently being used and free it. A frame can be freed by
writing its contents to swap space, and changing the page table to indicate
that the page is no longer in memory. Now the freed frame can be used to hold
the page for which the process faulted.
22. What is the various Page Replacement Algorithms
used for Page Replacement?
FIFO page replacement
Optimal page replacement
LRU page replacement
LRU approximation page replacement
Counting based page replacement
Page buering algorithm
23. What are the major problems to implement
The two major problems to implement demand paging is
Frame allocation algrorithm
Page replacement algorithm
24. What is a Reference String?
An algorithm is evaluated by running it on a particular string
of memory references and computing the number of page faults. The string of
memory reference is called a reference string.