1 of 51

OPERATION IN THE SYSTEM MEMORY MANAGEMENT MEMORY AND HIS/HER OTHERWISE , VIRTUAL ADDRESS SPACE , MEMORY MANAGEMENT GENERAL PRINCIPLES ,

Lecture

2 of 51

CONTENT

1. Physical memory of a computer

2. The concept of address space

3. Swapping

4. Memory management system function

5. Virtual memory​

6. Conclusion

7. References

3 of 51

KEYWORDS

Physical memory

Logical memory

Swapping

Cache memory

Abstraction

Virtual memory

4 of 51

MEMORY MANAGEMENT

Memory management is​ computer system to work optimization during this memory demand to do different processes between limited in quantity physicist memory distribution process .

5 of 51

MEMORY MANAGEMENT

6 of 51

TYPES OF COMPUTER MEMORY

Basically, memory comes in three forms:

Cache memory is a small amount of memory that is very fast to access by the system .

Main memory is the computer's random access memory ( RAM ) .

Secondary memory is a computer's hard drive, magnetic disk drives , or virtual memory that stores data related to various programs.

7 of 51

RAM-RANDOM ACCESS MEMORY

Quick memory ( visual RAM-Random Access Memory)- computer electricity to the source related was memory is considered .

Quick memory frequency — fast memory from tires known time inside passing information stream number .

DDR – ( Double Data Rate Synchronous Dynamic Random Access Memory )

Operative memory appearance and to the board ( motherboard) board ) connection according to one how many to types is divided . The current time operative DDR1, DDR2, DDR3 memory types is divided .

Information fast in memory charge there is or to the absence with 1 or 0 ( bits ) depending on is encoded . Modern fast 1 bit of information in memories storage 1 transistor for and 2 capacitors is used . Quick of memory speed It is measured in nanoseconds (ns) : 1 ns = 1/(1 billion) seconds . Fast memory devices following to types they separate :

8 of 51

TYPES OF MEMORY ( IN TERMS OF FUNCTION )

SIMM ( Single-Line Memory Modules ) – read and write through a single chip

DIMM ( Dual-Line Memory Modules ) – two-chip memory read and write

DRAM ( Dynamic Random Access Memory ) – memory is accessed in a short time and is automatically reloaded

SDRAM ( Static RAM ) – does not reload and works faster than DRAM

Flash Memory – a type of memory designed to be rewritten and combining the features of RAM and a hard disk

Shadow RAM – Used by BIOS code and located in ROM (works faster than RAM)

9 of 51

SIMM

SIMM (Single In-line Memory Module) output of ties one in line located memory module. Every 72 exits from the side has although both​ exit on the side couples mutual close-up and that's why for unilateral is considered . In SIMM memory The memory is 32 ( 36 pairs ) bits , which is compatible with Pentium processors. has was on computers only pair become usage possible . Current on the day not applicable .

DIMM (Dual In-line Memory Module) output connections two in line located memory module. It has 168, that is of the board every 84 on the side to the clutch has . Present on the day almost DDR SDRAM (Double Data Rate SDRAM) speed two times increased

For example , 2 GHz frequency to the processor work fruit high to be for his/her at the frequency working capacity from 256 KB small not been cache memory and information size from 256 MB and speed from 0.5 Ns small non -RAM compatible comes . Such compatibility special programs using from the test transfer possible .

10 of 51

MEMORY TYPES

11 of 51

PHYSICAL ORGANIZATION OF COMPUTER MEMORY

Computer memory – a storage device

Divided into 2 levels

Main memory

( head , operative , physicist )

Secondary

( external )

12 of 51

Processor registers

Processor cache

Main memory

Electronic disk

Magnetic disk

Magnetic tape

Memory hierarchy

Application time

Price

13 of 51

The simplest memory management scheme

Every process

I

Swapping added

II

Fully fits into memory

New process

By removing another process from memory ( according to certain criteria )

placed

14 of 51

MEMORY MANAGEMENT

    • Logical address – using CPU generated ; virtual address such as explained
    • Physicist address – memory address in the block it seems

15 of 51

PLACEMENT ALGORITHM

  • Most operational systems ( e.g. Windows and Linux) with Paging From segmentation uses .
  • Process into segments divided and separately in segments pages there is .
  • In Partition Allocation, the process on demand answer giving one how many department there is when , section selection need . Specific the section choice for the section distribution method need . Section distribution method internal to break up road if not better is considered .
  • The process main to memory loading time when it arrives and enough in size one how many empty memory block there is If so , then which OS ? empty block separation solution does .

16 of 51

VARIOUS KIND PLACEMENT ALGORITHM THERE IS :

First Fit in place , Home Of memory high in the part first enough block was department is separated .

He remembers. from the beginning checks and enough big was first block chooses . So so that's enough big was first the hole separates .

17 of 51

BEST FIT

The process free there is department between enough small was first to the department Separate the holes .

whole list is looking for , its size process from the size bigger or equal was the most small the hole finds .

18 of 51

WORST FIT

The process main in memory there is was free sections between enough bigger to part separate .

This is the most good suitable to the algorithm opposite . He is the most big the hole find and him/her again to work separation

for of holes whole list is looking for .

19 of 51

COME ON , EVERYONE. OPTIONS TRY LET'S SEE�

Best Fit:

  • 300K 350K in size from the block allocated . 50 left in the block .
  • 25K to 150K blocks separated . This 25K remains in the block .
  • though there is a 25K + 25K space, 50K is allocated It won't be possible .
  • the remaining 50K blocks issued . 25K left in the block .

First Fit:

  • 300K requests from 350K blocks allocated , 50K left .
  • 25K to 150K blocks allocated , 125K left .
  • Then The remaining left parts are divided into 125K and 50K .
  • So first​​ compatibility requests to do possible .
  • As a result , option B right is a choice .

20 of 51

VIRTUAL MEMORY

Virtual memory is​ computer actually To RAM than more physical To RAM has who feels that hardware with provided mechanism . This physicist from memory unused information delete and current the operation to perform for necessary was things replacement with done increases . This the process supportive system to the component memory manager or memory department �(MMU — memory management unit)) is called .

21 of 51

VIRTUAL MEMORY MANAGEMENT

Virtual memory is imagined​​​​ memory . Virtual memory size real physical  memory from the size many will be . Such the method selectively to take reasons , first of all of memory every one the address choice if , then secondly real operative of memory price tag one a little Maybe because of its price .

Virtual memory sheet by sheet organization Every​​ one on the sheet determined of memory information unit for own address there is These addresses will be  sequence their  appearance and writing every one sheet for one kind The real address of virtual memory is  when calculated  on the sheet  address to the value sheet coefficient is added . Therefore addresses confusion took is taken . That is , if we take a how many in the name street let's see every one There is a house number 13 on the street . if so , then a 13th house address different will be , because streets name different .

22 of 51

PROCESSES IN WINDOWS ADDRESS FIELD

Virtual memory address 32- bit Windows OS address pointer as ( 4 bytes), uses , addresses field 2 32 = 4294967296 bytes what organization ( 4 gigabytes, GB) . 16 GB count of addresses range : 00000000 - FFFFFFFF.

23 of 51

PROCEDURES OPERATIVE IN MEMORY APPEARANCE

24 of 51

PAGE AND PAGE SCHEDULE�

25 of 51

PAGING FILE

On disks segments and pages temporary storage for special field ( paged) file or files sucking paging file) is allocated .

26 of 51

Processors with separable addresses generation :

    • Page number (p) – physicist of memory pages own inside recipient basic address that is pages in the table index as is used .�
    • Mix page (d) – memory block sender physicist address memory determination for basic address with union .

26

Memory management

4096 bytes = 2^12 – hash 12 bit request for will reach .

d

p

27 of 51

VIRTUAL ADDRESS

Virtual page number

Virtual page intervention

P

S V

Pages table elementary address

OT

+

Pages schedule

N f.s.

P

A

D

W

N1

N2

1 0 1 0

1 0 1 0

1 0 0 0

N2

S F

Operative memory

N2

S F

0

AT

28 of 51

TWO LEVEL PAGED ORGANIZATION

Processor registry

Pages root to the table indicator

10 bits

10 bits

12 bits

Virtual address

mixture

N physical page​

+

+

4 KB

4 KB (1024 records )

Pages root schedule (1024 entries )

Sizeable page schedule

Page-based interruptions

Operative memory

29 of 51

Virtual address

TLB

Pages schedule

External memory

Pages number

Mixture

N physical page​ mixture

Home memory

TLB search successful

TLB search successful it's not

Pages loading

those pages appeal error ( page error) interruption )

Pages schedule update

QUICK ADDRESS CHANGE BUFFER

30 of 51

ASSOCIATIVE TO DESCRIBE

512 65 1 1 1 0 45312

7812 0 1 1 0 22233

912 0 1 1 1 6253

452 1 1 1 0 1234

34233 1 1 1 0 53

11233 0 1 1 0 453

452

674

Page number

Mixture

Page number

Managed information

Physicist page number

1234

Page physicist number

674

mixture

Real address

TLB ( Translation Lookaside Buffer ) – change buffer

31 of 51

Mixture

TLB

Operative memory

Page schedule

N phys . page .

Cache

N virt . page .

mixture

Virtual address

There is it's not

There is

Value

Missing

Home memory and TLB( change buffer ) with mutual movement

32 of 51

MEMORY MANAGEMENT

Physicist cache because of program memory wanted from the place separation possible .

32

Paging

Hard drive

Address to be determined :

 

page number ( table) inside index ) + intervention

---> show --->

basic address ( from table ) + intervention .

Frames = physics blocks

Pages = logical blocks

Frame/page size is placed on the hard disk

33 of 51

    • 32 bit machine address 4GB to do possible , that's 4 million pages (1024bytes/ page )
    • Separated from registers use possible .
    • In memory the table indicator from registers forging possible ( slow )
    • Cache or associative memory
    • (TLB = Translation Look-a-side Buffer):
    • one of time in his own search and one how many from the register use

 

33

Memory management

Paging

Table of the page execution

TLB = Translation Look-a-side Buffer

34 of 51

MEMORY MANAGEMENT SYSTEM FUNCTION

To ensure efficient use of memory, the operating system must perform the following tasks :

  • Mapping a set of process addresses in a specific area of physical memory ;
  • Sharing memory between conflicting processes ;
  • Processes control access to the address space ;
  • Offloading processes ( partially or completely ) to external memory when there is no space left in RAM ;
  • Taking into account free and used memory .

35 of 51

LOGICAL MEMORY.

The organization of memory as a linear collection of cells does not correspond to the programmer's idea of how programs and data are stored. Many programs are composed of modules that are created independently of each other.

Sometimes process to the composition incoming everyone modules in memory are placed in a row and striped addresses the area organization does . But often modules of memory various in places will be placed and various is used .

36 of 51

LOGICAL MEMORY ( CONTINUED )

Remember the segment exactly indicated part is , it is in the interior striped addresses support A segment can be a procedure, array, stack , or scalar quantity . organization found b will die , but usually mixed typical from the data consists of It won't happen .

37 of 51

38 of 51

SEGMENT-MEMORY ORGANIZATION

39 of 51

SEGMENTED MEMORY

40 of 51

Fixed section scheme

Memory is pre-partitioned into chunks of a certain size . Processes are placed in these chunks.

Section 1

Section 2

Section 2

Section 1

Section 3

OT

Section 3

OT

(a)

( b )

41 of 51

OVERLAY

Home idea – only same as needed​​ was​​ program instructions​​ in memory save is to stand .

  • Overlay​​ structure of the program code on disk clear memory in the form of will be​ and necessary​​​​​ at the time him/her read through the driver​​​ uses .
  • The structure of the upper​ description to write for usually special simple ( overlay description language) language is used .
  • In the program used everyone files of the program internal to their calls tree in appearance file using is filled .

42 of 51

Overlay structure

AB, ACD and ACE are in turn memorized. branches are located

43 of 51

SWAPPING

Time distribution systems with work in time, memory everything users processes in itself hold stand unobtainable situation happening​​​ possible . In this case from swapping to use That 's right .​

Swap-it processes main from memory disco and back complete is to transfer . The processes to disk partially loading page-shaped organization done in the system done is increased .

Swapping memory no means of control connection no, he/she more process planning​​ with is related .

44 of 51

45 of 51

MEMORY MANAGEMENT

Memory space : A program written in C or Java uses the following memory spaces :

    • Static : is prepared during the program compilation process and is created in memory when the program is run .
      • Used for global and immutable (const) variables
    • Stack : This memory is dynamically allocated and works on the basis of LIFO property .
      • Used for local variables and function parameters
    • Heap : This type of memory space is also dynamically allocated and created in different locations .
      • It is used to create dynamic arrays and objects . In Java, all objects are created on the heap .

46 of 51

VIRTUAL MEMORY MANAGEMENT

page

swapped

out

swap

file

Virtual memory

management

Hard drive

page

swapped

in

memory

47 of 51

VIRTUAL MEMORY

Process appeal to do addresses , operative in memory there is from real addresses this in analysis difference does .

Every one clear in case program using address , address kind methods using to be described possible .

For example : address given in the text usually symbolic will be.Compiler this symbol address and changeable addresses unites .

Program from generated then address usually logical address (virtual memory) In systems it is often called virtual memory .

All logical addresses package logical (virtual) addresses is called the area .

48 of 51

VIRTUAL MEMORY

49 of 51

50 of 51

CONTROL QUESTIONS

1. Types of memory ?

2. What is swapping ?

3. What is the simplest memory management scheme and explain it ?

4. The difference between stack and heap ?

5. What is virtual memory ?

6. What is the difference between RAM and ROM ?

51 of 51

REFERENCES