1 / 31

MEMORY MANAGEMENT

MEMORY MANAGEMENT. IM PM MM 3 SERVICES OF OS MM. MM. Keep track of all Mem locns free (F) or allocated (Al) & if al to which PR.. & how much Decide Mem allocn. Policy – which PR. should get how much Mem, when & where

mckile
Download Presentation

MEMORY MANAGEMENT

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. MEMORY MANAGEMENT IM PM MM 3 SERVICES OF OS • MM.

  2. MM • Keep track of all Mem locns free (F) or allocated (Al) & if al to which PR.. & how much • Decide Mem allocn. Policy – which PR. should get how much Mem, when & where • Algs to al & deallocate ( D’al) – normally – help of spl.. Hardware

  3. MMS • Contiguous real MMS • Single contiguous MMS • Fixed partition MMS • Variable partition MMS • Non – Contiguous Real MMS • Paged MMS • Segmented MMS • Combined MMS

  4. Non – contiguous, Virtual MMS

  5. FOLLOW ISSUES • Relocation & Addrs translation • Protection & sharing(10 copies of wp) • Evaluation Wasted Mem Access time – OS to Mem(expln) Time complexity-Overhead of Al.. D’Al

  6. SINGLE CONTIGUOUS M.M. At any time Only 1 PR is in mem • Taken to completion OS USER

  7. Scheme • All RDY PR’ held on disk as executable Images – OS holds their PCB in Mem – Q • At any time – one of them runs. • When PR.. is blocked – swapped out • Next prior PR.. – swapped in • 1- PR Rng – though conceptually it is a multi programming syst

  8. evaluation • Does not have a large wasted Mem. Fast ( no AT reqd) • Very little time complexity • Lim use – because of lack of multi-user facility

  9. Protection & sharing • Protection bit 0 –os 1 - user

  10. Fence reg os FENCE user

  11. FIXED PARTITION MM Could be of diff sizes – fixed

  12. When a partition is to be allocd.. To a PR the Follow takes place 1) Long T Sch of PM – decides – PR to Mem 2) Size from IM 3) Request to MM for partn allocn 4) With IM’ help – loads progr 5) Entry in PDT ( partition description T) 6) Allocated -7) PM sched this PR

  13. Allocation algorithms • First fit, best fit, worst fit • Multiple Qs linked lis of PCBs in “RDY but not in Mem” Q0 –0 -2k(PRs with 0 to 2k requirement) Q1 – 2k – 5k Q2 – 5k – 8k

  14. Sched- Round Robin priority Advantage : V Small PR.. Is not loaded in a v large Partn.. – avoids Mem wastage Disadvantage : could have a long Q for a smaller partn whereas Q for the bigger partn could be empty.

  15. Single Q • Any algor –Priority FF, BF, WF • EXTERNAL FRAGMENTATION • INTERNAL FRAGMENTATION

  16. SWAPPING Lifting the program form Mem & Placing it On the disk is called swapping out swapping in A blocked PR.. Is swapped out to make room for a RDY PR.. To improve CPU utilization

  17. RELOCATION & ADDRS TRANSLATION Compiler will compile starting – 0 address virtual address or logical address – Progr may be loaded in diff addrs –physical addrss. AT must be done for all instrns except for Consts, phys I/O Port addresses & offsets which are related to PC in rel address mode.

  18. STATIC RELOCN & AT

  19. Changes the addresses in each instrn., Before it is loaded --- earlier IBM – S/W TRANSLN.. SLOW

  20. DYNAMIC RELOCATION Used at RUN time for each instrn… BASE REG (ex- 1000) LDA 500 Imagine a progr.. Of size 1000W the Virtual address or logical address space For this progr.. 0to 999 1000 as base Address 1000 – 1999

  21. Phys address space When partn.. Algm ( FF, BF, etc) allocates A partn.. For a PR.. & PCB is created – Base address – stored in PCB

  22. Only the base reg value needs to be changed before dispatching. PROTECTION Protection bits – IBM 360 / 370 4 bits Reserved – 16 user PRS… in 16 partitions

  23. Block – 2KB. IF PR = 10KB + 1B it will Require partn with 12KB – internal fragmn.. When a PR.. Is loaded in a partn, Key of that partn.. – STORED in PSW.

  24. 4 MAJOR DRAWBACKS • Internal fragmn.. • Limits the max no. of partns… - PRS.. • Does not allow sharing easily – separate keys for shared PRS.. • H/W Malfn.. – system cannot detect it.

  25. LIMIT REG Ensures that the virtual address is within the bounds of the PR.. Address space Ex. Progs size 1000 – Virtual address Space – 0 to 999 Limit reg would be set to 999. If it is not within the bounds, H/W – gener error – aborted.

  26. SHARING – In fixed partn – not followed in practice EVALUATION – If 100K Partn is allocated to 60K PR.. – wasted – intern fragmn.. – If 2 parts of 20K & 40K are available & a PR of 50k has to be accom –not possible –contg – extern fragmn Access time: not very high bec of H/W Time complexity:very low bec alloc/deall routines are simple bec-fixed partns

More Related