UNIT 5
Memory Management, Virtual Memory
2. What is Address Binding of memory management in an operating system?
- Compile Time- The principal kind of address binding is compiling time address binding. This distributes a space in memory to the machine code of a PC when the program is assembled to an executable binary file. The address binding designates a logical address to the beginning stage of the segment in memory where the object code is put away. The memory assignment is long term and can be modified distinctly by recompiling the program.
- Load Time- On the off chance that memory allotment is assigned at the time the program is allocated, at that point no program can ever move starting with one computer then onto the next in its compiled state. This is on the grounds that the executable code will contain memory distributions that may as of now be being used by different programs on the new computer. In this case, the program's logical addresses are not bound to physical locations until the program is conjured and stacked into memory.
- Execution Time- Execution time address binding normally applies just to factors in programs and is the most well-known type of binding for contents, which don't get compiled. In this situation, the program demands memory space for a variable in a program the first time that variable is experienced during the processing of instructions in the content. The memory will distribute space to that factor until the program arrangement closes, or except if a particular guidance inside the content discharges the memory address bound to a variable.
3. What is Dynamic Loading in memory management in an operating system?
4. Explain Logical Versus Physical Address space.
Mapping virtual-address to physical-addresses
5. What is swapping in memory management?
- Static movement: In the static migration swapping never to be performed in light of the fact that the process are consistently have a memory. This isn’t to be changed at the execution time. For instance the memory which is given to the input and output tasks and the memory which is given to the CPU to executing the processes won't be changed with the goal that this is otherwise called the static migration of the memory.
- Dynamic migration: The dynamic migration is otherwise called the memory which is changed and moves by the processes at the time of execution. So that there must be some system to give memory those processes those are running. The mapping of the logical address into the physical address will be performed at the time of execution or at run time.
6. Explain Contiguous Memory Allocation
Contiguous memory allocation is an old style memory allotment model that allocates a process back to back memory blocks (that is, memory blocks having sequential addresses).
Contiguous memory allocation is one of the most established memory allotment design.
At the point when a process needs to execute, memory is requested by the process. The size of the process is examined and the measure of contiguous main memory accessible to execute the process.
In the event that adequate contiguous memory is discovered, the process is allotted memory to begin its execution. Else, it is added to a queue of waiting processes until adequate free contiguous memory is accessible.
In the contiguous memory allocation, both the operating system and the user must stay in the main memory.
The main memory is separated into two parts one segment is for the operating system and other is for the user program.
There are two different ways of allocating a memory to process as fixed sized partitions or variable sized partitions.
Fixed sized partition
Advantage:
Disadvantage:
Variable size partition
Advantage:
Disadvantage:
7. What are some of the allocation strategies and define fragmentation?Allocation Strategies
- First fit. Assign the first block that is huge enough to accommodate a process. Searching will start from the beginning or where the past first-fit inquiry finished. We can quit looking when we locate a free gap that is enormous enough.
- Best fit. Assign the smallest block that is huge enough. We should look through the whole list, except if the rundown is requested by size. This methodology delivers the smallest remaining block.
- Worst fit. Assign the biggest block. Once more, we should look through the whole list, except if it is arranged by size. This system delivers the biggest extra gap, which might be more valuable than the littler remaining gap from a best-fit methodology. Neither first fit nor best fit is plainly superior to the next as far as storage usage, however first fit is commonly quicker.
8. Explain Paging in detail in memory management.
Paging Hardware
Paging model of logical and physical memory
page number | page offset |
p | d |
m - n | m |
where p is a index into the page table and d is the displacement inside the page.
Main memory access time = m
In the event that page table are kept in main memory,
Successful Access time = m(for page table) + n(for specific page in page table)
9. Explain Segmentation in memory management
- Virtual memory segmentation – Each process is partitioned into various segments, not which are all inhabitant at any one point in time.
- Simple Segmentation – Each process is partitioned into various segments, which are all stacked into memory at run time, however not really contiguously.
- Base Address: It contains the beginning physical address where the fragments reside in memory.
- Limit: It determines the length of the fragment.
10. Explain Translation of Logical Address into Physical Address.
- Segment number (s): Number of bits required to speak to the portion.
- Segment balance (d): Number of bits required to speak to the size of the fragment.
Advantages-
Disadvantages-