Presentation is loading. Please wait.

Presentation is loading. Please wait.

Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 0 Lesson 7 Memory Management.

Similar presentations


Presentation on theme: "Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 0 Lesson 7 Memory Management."— Presentation transcript:

1 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 0 Lesson 7 Memory Management

2 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 1 LESSON OVERVIEW  areas of memory management  Memory and storage management  Memory management in virtual systems  Address translation mechanisms  Memory management problems  Manual memory management  Automatic memory management

3 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 2 Areas Of Memory Management Memory management is usually divided into three areas:  Hardware  Operating system  Application

4 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 3 Hardware Memory Management Memory management at the hardware level is concerned with the electronic devices that actually store data. This includes things like RAM and memory caches.

5 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 4 Operating System Memory Management In the operating system, memory must be allocated to user programs, and reused by other programs when it is no longer required. The operating system can pretend that the computer has more memory than it actually does, and also that each program has the machine's memory to itself.

6 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 5 Application Memory Management_1 It involves supplying the memory needed for a program's objects and data structures from the limited resources available, and recycling that memory for reuse when it is no longer required. Because application programs cannot in general predict in advance how much memory they are going to require, they need additional code to handle their changing memory requirements.

7 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 6 Application Memory Management_2 Application memory management combines two related tasks:  Allocation  Recycling

8 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 7 Application Memory Manager  CPU overhead  Interactive pause times  Memory overhead

9 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 8 Memory In Computer System  Virtual memory  High-speed cache  Main memory  Secondary memory

10 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 9 Memory Management In Virtual System  Demand Paging  Fetching  Perfecting  Replacement Strategies

11 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 10 Memory Manager  Provides abstraction of a protected address space through translation.  Provides the abstraction of large virtual address spaces, effectively liberating programmers from physical memory constraints.

12 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 11 Address Translation Mechanisms_1  Efficiency in sparse address space  Address translation for protection  Generic address translation  Obvious solution

13 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 12 Address Translation Mechanisms_2  Paging  Protection  Problems  Advantages  Obvious solution

14 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 13 Memory Management Problems  Typical Problem  Parameter free or dangling pointer  Memory leak  External fragmentation  Poor locality of reference  Inflexible design  Interface complexity

15 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 14 Advantages Of Memory Management  It can be easier for the programmer to understand exactly what is going on;  Some manual memory managers perform better when there is a shortage of memory.

16 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 15 Disadvantages Of Memory Management  The programmer must write a lot of code to do repetitive bookkeeping of memory;  Memory management must form a significant part of any module interface;  Manual memory management typically requires more memory overhead per object;  Memory management bugs are common.

17 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 16 Manual Memory Management In Most Implementations  Algol  C  C++ The following languages use mainly manual memory management in most implementations, although many have conservative garbage collection extensions:  COBOL  Fortran  Pascal.

18 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 17 Advantages Of Automatic Memory Management  The programmer is freed to work on the actual problem  Module interfaces are cleaner  There are fewer memory management bugs  Memory management is often more efficient

19 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 18 Disadvantages Of Automatic Memory Management  Memory may be retained because it is reachable, but won't be used again;  Automatic memory managers (currently) have limited availability.

20 Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 19 Most Modern Languages Used Mainly In Automatic Memory Management  BASIC  Dylan TM  Erlang  Haskell  Java TM  JavaScript TM  Lisp  ML  Modula-3  Perl  thePostScript ® language  Prolog  Python  Scheme  Smalltalk


Download ppt "Copyright © Genetic Computer School 2008 Computer Systems Architecture SA 7- 0 Lesson 7 Memory Management."

Similar presentations


Ads by Google