UNIT-4
Memory organization
Q1) Give an overview of memory management
A1)
Q2) What is the Address Binding of memory management in an operating system?
A2)
- Compile Time- The principal kind of address binding is compile time address binding. This distributes 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 to start with one computer then onto the next in its compiled state. This is because 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 particular guidance inside the content discharges the memory address bound to a variable.
Q3) What is Dynamic Loading in memory management in an operating system?
A3)
Q4) Explain Logical Versus Physical Address space
A4)
Mapping virtual-address to physical-addresses
Q5) What is swapping in memory management?
A5)
- Static movement: In static migration swapping never to be performed because the process is consistently has 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 to those processes that are running. The mapping of the logical address into the physical address will be performed at the time of execution or at run time.
Q6) Explain Contiguous Memory Allocation
A6)
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.
If 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 the other is for the user program.
There are two different ways of allocating memory to process as fixed-sized partitions or variable-sized partitions.
Fixed sized partition
Advantage:
Disadvantage:
Variable size partition
Advantage:
Disadvantage:
Q7) What are some of the allocation strategies and define fragmentation?
A7)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 superior to the next as far as storage usage, however first fit is commonly quicker.
Q8) Explain Paging in detail in memory management
A8)
Paging Hardware
Paging model of logical and physical memory
page number | page offset |
p | d |
m - n | m |
where p is an index into the page table and d is the displacement inside the page.
Main memory access time = m
If the page table is kept in the main memory,
Successful Access time = m(for page table) + n(for specific page in page table)
Q9) Explain Segmentation in memory management
A9)
- Virtual memory segmentation – Each process is partitioned into various segments, not which are all inhabitants 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 continuously.
- Base Address: It contains the beginning physical address where the fragments reside in memory.
- Limit: It determines the length of the fragment.
Q10) Explain Translation of Logical Address into Physical Address
A10)
- 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-