Wednesday, August 26, 2020
Memory Management Strategies
ITCS 343 Opera-ng System Principles Memory Management Strategies Virtualizing Resources â⬠¢? Physical Reality: Di? erent Processes/Threads share a similar equipment ââ¬? Need to mul-plex CPU (Just ?nished: planning) ââ¬? Need to mul-plex utilization of Memory (Today) ââ¬? Need to mul-plex plate and gadgets (later in term) ââ¬? The total working condition of a procedure as well as portion is de? ned by its information in memory (and registers) ââ¬? Thusly, can't simply let di? erent strings of control utilize a similar memory ââ¬? Presumably donââ¬â¢t need di? erent strings to try and approach each otherââ¬â¢s memory (protec-on) â⬠¢?Physics: two di? erent bits of information can't possess the equivalent loca-ons in memory â⬠¢? Why stress over memory sharing? Memory Hierarchy of a Modern Computer System â⬠¢? Exploit the standard of territory to: ââ¬? Present as much memory as in the least expensive innovation ââ¬? Give access at speed o? ered by th e quickest innovation Processor Control Second Level Cache (SRAM) Main Memory (DRAM) Secondary Storage (Disk) Tertiary Storage (Tape) On-Chip Cache Registers 1s 100s Datapath Speed (ns): Size (bytes): 10s-à ? 100s Ks-à ? Ms 100s Ms 10,000,000s 10,000,000,000s (10s ms) (10s sec) Gs Ts Background ? Program must be brought (from plate) into memory and set inside a procedure for it to be run â⬠¢? CPU can get to legitimately to registers and principle memory ââ¬? Register access in one CPU clock (or less) ââ¬? Principle memory can take numerous cycles â⬠¢? Store sits between principle memory and CPU registers - à ? to lessen CPU inactive .me and make the accessible information quicker to get to. â⬠¢? Protec-on of memory guarantees right show on ââ¬? to secure the show. ng framework from access by client forms and, ââ¬? to shield client forms from each other. ââ¬? One straightforward implementa. on is through base and cutoff registers Mulââ¬Ã¢ ? stepProcessi ng of a Program for Execu-on â⬠¢? Prepara-on of a program for execu-on includes segments at: â⬠¢? Addresses can be bound to ?nal values anyplace in this way â⬠¢? Dynamic Libraries ââ¬? Arrange - me (I. e. ââ¬Å"gccâ⬠) ââ¬? Connection/Load - me (unix ââ¬Å"ldâ⬠does interface) ââ¬? Execu-on - me (e. g. dynamic libs) ââ¬? Relies upon equipment support ââ¬? Likewise relies upon drama ng framework ââ¬? Connecting delayed un-l execu-on ââ¬? Little bit of code, stub, used to find the proper memory-à ? occupant library rou-ne ââ¬? Stub replaces itself with the location of the rou-ne, and executes rou-ne Mulââ¬Ã¢ ? step Processing of a Program or Execu-on â⬠¢? Client programs experience a few stages before having the option to run. â⬠¢? This mulââ¬Ã¢ ? step preparing of the program summons â⬠¢? The proper u-lity (the square shape) â⬠¢? Creates the necessary module at each progression (the circle) â⬠¢? Essentially, it is abo ut tie â⬠address mapping. Authoritative of Instruc9ons and Data to Memory â⬠¢? Address authoritative of instruc-ons and information to memory locations can occur at three di? erent stages ââ¬? Gather 9me: If memory loca-on known from the earlier, outright code can be produced; must recompile code if star-ng loca-on changes ââ¬? Burden 9me: Must produce relocatable tribute if memory loca-on isn't known at arrange - me ââ¬? Execu9on 9me: Binding deferred un-l run - me if the procedure can be moved during its execu-on starting with one memory portion then onto the next. Need equipment support for address maps (e. g. , base and cutoff registers) â⬠¢? Controlled cover: â⬠¢? Address Type: ââ¬? Separate condition of strings ought not crash in physical memory. Clearly, sudden cover causes disorder! ââ¬? On the other hand, might want the capacity to cover when wanted (for communica-on) ââ¬? A physical (outright) address is a physical loca-on in fundamental memory. ââ¬? A consistent (virtual) address is an eference to a memory loca-on that is autonomous of the physical organiza-on of memory. ââ¬? All memory references in client process are consistent locations. ââ¬? A rela-ve address is a case of consistent location where the location is communicated as a loca-on rela-ve to some known point in the program (ex: the starting location). â⬠¢? Transla-on: â⬠¢? Protec-on: ââ¬? Capacity to decipher gets to from one location space (virtual) to a di? erent one (physical) ââ¬? When transla-on exists, processor utilizes virtual locations, physical memory utilizes physical locations ââ¬? Side e? ects: Can be utilized to keep away from overlap,Can be utilized to give uniform perspective on memory to programs ââ¬? Forestall access to private memory of different procedures â⬠¢? Di? erent pages of memory can be given uncommon conduct (Read Only, Invisible to client programs, and so forth). â⬠¢? Portion information shielded from User programs â⬠¢? Projects shielded from themselves Base and Limit Registers â⬠¢? Each procedure has a different memory space (coherent/client address space). â⬠¢? A couple of base and cutoff registers de? ne the intelligent location space ââ¬? base register holds the littlest lawful physical location ââ¬? limit register speci? es the size of the scope of a procedure â⬠¢? Could se base/limit for dynamic location transla9on (oBen called ââ¬Å"segmenta9onâ⬠): ââ¬? Adjust address of each heap/store by including ââ¬Å"baseâ⬠ââ¬? Client permitted to peruse/compose inside portion à »? Gets to are rela9ve to section so donââ¬â¢t must be moved when program moved to di? erent section ââ¬? Client may have mul9ple fragments accessible (e. g x86) à »? Loads and stores incorporate fragment ID in opcode: x86 Example: mov [es:bx],ax. à »? Opera9ng framework moves around fragment base pointers as important Mul-programming â⬠¢? Issue: Run mul-ple app lica-ons so that they are shielded from each other â⬠¢? Objectives: ââ¬?Isolate procedures and piece from each other ââ¬? Permit ?exible transla-on that: â⬠¢? Doesnââ¬â¢t lead to fragmenta-on â⬠¢? Permits simple sharing between forms â⬠¢? Permits just piece of procedure to be occupant in physical memory â⬠¢? (A portion of the required) Hardware Mechanisms: ââ¬? General Address Transla-on ââ¬? Double Mode Opera-on â⬠¢? Adaptable: Can ?t physical lumps of memory into self-assertive places in clients address space â⬠¢? Not constrained to modest number of portions â⬠¢? Think about this as giving an enormous number (a large number of) ?xed-à ? measured fragments (called ââ¬Å"pagesâ⬠) â⬠¢? Protec-on base including piece/client dis-nc-on
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.