0% found this document useful (0 votes)
32 views5 pages

QBUnit - III

Uploaded by

Pon Murugan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views5 pages

QBUnit - III

Uploaded by

Pon Murugan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

UNIT-III

MEMORY MANAGEMENT

Part-A

1. Define Dynamic Loading.


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 read-only
page.
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 internal fragmentation.
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 i f 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 Paging?
When the bit is set to valid, this value indicates that the associated page is in the process’s 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 addresses.
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 is available.
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 close to 0; that is, there will be only a few page faults. The
effective access time is,
Effective access time = (1-p)*ma+p*page fault time
ma: memory access 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 Replacement?
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 buffering algorithm.
23. What are the major problems to implement Demand Paging?
The two major problems to implement demand paging is developing,
□ Frame allocation algorithm
□ 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.
25. 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 is
available.
26. 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.
PART-B

1. Differentiate local and global page replacement algorithm.


2. What is virtual memory? Mention its advantages.
3. What is the maximum file size supported by a file system with 16 direct blocks, single, double,
and triple indirection? The block size is 512 bytes. Disk block number can be stored in 4 bytes.
4. List the steps needed to perform page replacement.
5. Differentiate external fragmentation with internal fragmentation.
6. Briefly explain and compare, fixed and dynamic memory partitioning schemes.
7. Explain with the help of examples FIFO and LRU, optical page replacement algorithms with
example reference string. Mention the merits and demerits of each of the above algorithm.
8. Explain how paging supports virtual memory. With neat diagram explain hoe logical
address is translated into physical address.
9. Explain memory management in Linux operating system.
10. Give the basic concepts about paging.
11. Write about the techniques for structuring the page table.
12. Explain the basic concepts of segmentation.
13. What is demand paging and what is its use?
14. Explain the various page replacement strategies.
15. What is thrashing and explain the methods to avoid thrashing?
16. Write short notes on swapping.
17. Discuss the advantages of paging memory management and the conversion of logical address
into physical address with necessary
18. Consider the following page reference string: 2, 3, 4, 2, 1, 5, 6, 4, 1, 2, 3, 7, 6, 3, 2, 1 Calculate the
number of page faults would occur for the following page replacement algorithm with frame size of
4 and 5.
19. Explain the page fault handling routine with diagram.
20. Explain Contiguous and Noncontiguous memory allocation with example.
21. Explain page replacement algorithms.

You might also like