You are on page 1of 7

Contiguous Memory Allocationmean?

Contiguous memory allocation is a classical memory allocation model that assigns


a process consecutive memory blocks (that is, memory blocks having consecutive
addresses).

Contiguous memory allocation is one of the oldest memory allocation schemes.


When a process needs to execute, memory is requested by the process.

The size of the process is compared with the amount of contiguous main memory
available to execute the process.
If sufficient contiguous memory is found, the process is allocated memory to start
its execution. Otherwise, it is added to a queue of waiting processes until sufficient
free contiguous memory is available.

What does Secondary Memory mean?


Secondary memory is computer memory that is non-volatile and persistent in
nature and is not directly accessed by a computer/processor. It allows a user to
store data that may be instantly and easily retrieved, transported and used by
applications and services.

Secondary memory is also known as secondary storage.

Secondary memory consists of all permanent or persistent storage devices, such as


read-only memory (ROM), flash drives, hard disk drives (HDD), magnetic tapes
and other types of internal/external storage media. In computing operations,
secondary memory is accessed only by the primary or main memory and later
transported to the processor.
Consider a logical address space of 64 pages of 1,024 words each, mapped onto a
physical memory of 32 frames.
a. how many bits are there in the logical address?
b. how many bits are there in the physical address?

The logical address will have 16 bits and the physical address will have 15 bits.

Explanation :

a) Logical memory = 64 pages

= 2⁶ pages

size of each word = 1024 = 2¹⁰

Hence total logical memory = 2⁶ x 2¹⁰ = 2¹⁶

Hence the logical address will have 16 bits.

b) Physical memory = 32 frames

= 2⁵ frames

size of each word = 1024 = 2¹⁰

Hence total physical size = 2⁵ x 2¹⁰ = 2¹⁵

Hence there will be 15 bits in the physical address

Read more on Brainly.in - https://brainly.in/question/7071298#readmore


virtual memory

An
imaginary memory area supported by some operating systems (for
example, Windows but not DOS) in conjunction with the hardware.

You can think of virtual memory as an alternate set of


memory addresses. Programs use these virtual addressesrather than real
addresses to store instructions and data.

When the program is actually executed, the virtual addresses


are convertedinto real memory addresses.

The purpose of virtual memory is to enlarge the address space, the set of
addresses a program can utilize. For example, virtual memory might contain
twice as many addresses as main memory.

A program using all of virtual memory, therefore, would not be able to fit in
main memory all at once. Nevertheless, the computer could execute such a
program by copyinginto main memory those portions of the program needed
at any given point during execution.

To facilitate copying virtual memory into real memory, the operating system
divides virtual memory into pages, each of which contains a fixed number of
addresses.
Each page is stored on a diskuntil it is needed. When the page is needed, the
operating system copies it from disk to main memory, translating the virtual
addresses into real addresses.
The process of translating virtual addresses into real addresses is
called mapping. The copying of virtual pages from disk to main memory is known
as paging or swapping.

Each page has 1024 words.

Each page is 4096 bytes. i.e (4*1024 words).

A word is 32 bits or 4 Bytes.

Demand Paging

■ Bring a page into memory only when it is needed


● Less I/O needed
● Less memory needed
● Faster response
● More users

■ Page is needed -> reference to it


● invalid reference ->abort
● not-in-memory -> bring to memory
What happens if there is no free frame? ■ Page replacement – find some page in memory, but not really
in use, swap it out

seek time. Refers to the time a program or device takes to locate a particular piece
of data.

You might also like