Memory Management
- Memory management is
concerned with managing:
- The computer’s available
pool of memory
- Allocating space to
application routines and making sure that they do not interfere with each
other.
3.1.1 Identify between resident and transient routines
- The operating system is a collection of software routines.
Resident routines
|
Transient routines
|
Routines that directly
support application
programs as they run
|
Stored on disk and read
into memory only when
needed
|
Example: routine that
control physical I/O
|
Example: routine that
formats disks
|
- The operating system occupies low memory beginning with address 0. Key control information comes first followed by the various resident operating system routines.
- The remaining memory, called the transient area, is where application programs and transient operating system routines are loaded.
Resident & transient routines structure |
3.1.2 Explain the following related to memory management terminologies
a. Fixed – partition memory management- The simplest approach to managing memory for multiple, concurrent programs.
On many systems, multiple programs are loaded into memory and executed concurrently |
- Divides the available space into fixed-length partitions, each of which holds one program.
- Partition sizes are generally set when the system is initially started, so the memory allocation decision is made before the actual amount of space needed by a given program is known
|
- Fixed-partition memory management divides the available space into fixed length partitions each of which holds one program.
Advantages
|
Disadvantages
|
-Its
major advantage is simplicity
|
-
Because the size of a partition must be big enough to hold the largest
program that is likely to be loaded
-Fixed-partition
memory management wastes space
|
- The transient area is treated as a pool of unstructured free space.
- The system decides to load a particular program, a region of memory just sufficient to hold the program is allocated from the pool.
Advantages:
|
- Because a program gets only the space it needs
relatively little is wasted.
|
- Dynamic memory management does not completely solve the wasted space problem.
- Fragmentation (bits of unused space spread throughout memory) is a possible problem
3 algorithm for searching free block for a specific amount of memory:
- First fit
- Allocate the first free
block that is large enough for the new process.
This a fast algorithm.
2. Best fit
- Allocate the smallest block among those that are large enough for the new process.
- OS search entire list, or it can keep it sorted and stop it when it has an entry which has a size larger than the size of process.
- This algorithm produces the smallest left over block.
3. Worst fit
- Allocate the largest block among those that are large enough for the new process.
- Search or sorting of the entire list is needed.
- This algorithm produces the largest left over block.
Compaction:
- Method to overcome the external fragmentation problem.
- All free blocks are brought together as one large block of free space.
- For example, that a 640K program has just finished executing.If there are no 640K programs available, the system might load a 250K program and a 300K program, but note that 90K remains unallocated.If there are no 90K or smaller programs available, the space will simply not be used. The little chunks of unused space will be spread throughout memory, creating a fragmentation problem.
c. Segmentation
- With segmentation, programs are divided into variable size segments, instead of fixed size pages.
- Every logical address is formed of a segment name and an offset within that segment.
- Segments are numbered. Programs are segmented automatically by compiler or assembler.
- For logical to physical
address mapping, a segment table is used. When a logical address <s,
d> is generated by processor:
- Base and limit values corresponding to segment s are determined using the segment table. The OS checks whether d is in the limit. ( 0=<limit), then the physical address is calculated as ( based + d), and the memory is accessed.
d. Paging
- A programs segments can vary in length. Under paging, a program is broken into fixed-length pages. Page size is generally small (perhaps 2K to 4K), and chosen with hardware efficiency in mind.
- Like segments, a program’s pages are loaded into noncontiguous memory.
- Addresses consist of two parts , a page number in the high-order positions and a displacement in the low-order bits.
- Addresses are dynamically translated as the program runs. When an instruction is fetched, its base-plus displacement addresses are expanded to absolute addresses by hardware.
- Then the page’s base address is looked up in a program page table (like the segment table, maintained by the operating system) and added to the displacement.
Advantages:
|
Address translation: each task has the same
virtual address
|
Address translation: turns fragmented physical
addresses into contiguous virtual addresses
|
Memory protection (buggy or malicious tasks can't
harm each other or the kernel)
|
Demand loading (prevents big load on CPU when a
task first starts running, conserves memory)
|
Memory mapped files. Virtual memory swapping
(lets system degrade gracefully when memory required exceeds RAM size)
|
Segmentation and Paging
Process of segmentation and paging |
- With segmentation and paging, addresses are divided into a segment number, a page number within that segment, and a displacement within that page.
- After the instruction control unit expands the relative address, dynamic address translation begins.
- First, the program’s segment table is searched for the segment number, which yields the address of the segment’s page table.
- The page table is then searched for the page’s base address, which is added to the displacement to get an absolute address.
3.2 Understand Virtual Memory Management
- The word virtual means “not
in actual fact.” To the programmer or user, virtual memory acts just like
real memory, but it isn’t real memory.
- Virtual memory is a model
that holds space for the operating system and several application
programs.
- The operating system and
selected pages occupy real memory. Application programs are stored on an
external paging device.
Virtual memory structure
- Virtual memory is a model
that simplifies address translation. It “contains” the operating system
and all the application programs, but it does not physically exist
anywhere. Its contents are physically stored in real memory and on the
external paging device.
- Divided into two components.
- First components
- The first is exactly equal
to the amount of real memory on the system and is physically stored in
real memory.
- It contains the resident
operating system and the transient program area (called the page pool).
- Second components
- The second component of
virtual memory consists of space over and above real memory capacity.
- It is physically stored on
the external paging device and contains the application programs. The
operating system is loaded into real memory.
- Application programs are
loaded onto the external paging device. Selected pages are then swapped
between the real memory page pool and the external paging device.
3.2.1 Explain a Model of Virtual Memory
a. Demand Paging- In virtual memory systems, demand paging is a type of swapping in which pages of data are not copied from disk to RAM until they are needed.
- When the physical memory in the system runs out and a process needs to bring a page into memory then the operating system must decide what to do.
- Share the physical pages in the system between the processes running in the system, therefore it may need to remove one or more pages from the system to make room for the new page to be brought into memory. How virtual pages are selected for removal from physical memory affects the efficiency of the system.
- When programs are written, programmers take great care to make sure that code is not needlessly repeated.
- Subroutines to handle particular functions are written and used wherever possible. Subroutines that are useful to many programs are gathered together into libraries.
- These libraries are shareable so that running programs do not load several copies of the same code into memory. Instead only one copy of the code is loaded and all of the programs share that copy.
Virtual memory makes it easy for processes to share memory as all memory accesses are decoded using page tables. - For processes to share the same virtual memory, the same physical pages are referenced by many processes.
- The page tables for each process contain the Page Table Entries that have the same physical PFN.
Sharing Physical Memory Between Processes |
- Figure gif shows two processes that each have physical PFN 1 in their virtual memory map.
3.2.2 Describe Paged Virtual Memory
a. Page Tables- A page table is the data structure used by a virtual memory system in a computer operating system to store the mapping between virtual addresses and physical addresses.
- Virtual addresses are used by the accessing process, while physical addresses are used by the hardware or more specifically to the RAM.
- Dynamic address translation, or DAT, is the process of translating a virtual address during a storage reference into the corresponding real address.
- In a VS operating system, all non-resident programs exist in complete form only on auxiliary storage, which is where the OS loads them first. and the total virtual storage size of all executing programs usually exceeds the size of the real storage of the computer.
- In OS/390, both virtual and real storage are divided into 4096-byte chunks. The chunks are called pages on auxiliary storage, and page frames in real RAM.
- Paging is the name of the mechanism used to maintain the contents of real memory:
- When a program is first loaded, it is copied into contiguous virtual storage pages on auxiliary storage, not into real storage page frames in RAM.
- From that initial DASD storage location, a page is copied as needed into a real storage page frame by the OS/390 Paging Supervisor.
Page Frame Table
- The Page Frame Table contains lists, AKA "queues", of non-empty page frames. The actual number of the Active Queues is determined by the systems programmers and operators responsible for generating and running the system efficiently.
>>>>> Download Now
ReplyDelete>>>>> Download Full
>>>>> Download LINK
>>>>> Download Now
>>>>> Download Full
>>>>> Download LINK
oh no....
ReplyDeleteyalova
ReplyDeleteyozgat
elazığ
van
sakarya
EUBT2G
görüntülü.show
ReplyDeletewhatsapp ücretli show
1FN1N
edirne evden eve nakliyat
ReplyDeleteadana evden eve nakliyat
rize evden eve nakliyat
niğde evden eve nakliyat
gümüşhane evden eve nakliyat
6VJ78
denizli evden eve nakliyat
ReplyDeletekars evden eve nakliyat
çorum evden eve nakliyat
kars evden eve nakliyat
malatya evden eve nakliyat
030İRU
düzce evden eve nakliyat
ReplyDeletedenizli evden eve nakliyat
kırşehir evden eve nakliyat
çorum evden eve nakliyat
afyon evden eve nakliyat
XJ1
244D5
ReplyDeleteAnkara Asansör Tamiri
Mardin Lojistik
Artvin Evden Eve Nakliyat
Çerkezköy Kurtarıcı
Hakkari Lojistik
Eskişehir Lojistik
Uşak Şehir İçi Nakliyat
Maraş Evden Eve Nakliyat
Eskişehir Parça Eşya Taşıma
50CAC
ReplyDeleteÜnye Çelik Kapı
Zonguldak Şehir İçi Nakliyat
Tokat Evden Eve Nakliyat
Bayburt Şehir İçi Nakliyat
Siirt Şehirler Arası Nakliyat
Bartın Şehir İçi Nakliyat
Tunceli Evden Eve Nakliyat
Niğde Parça Eşya Taşıma
Mamak Fayans Ustası
CE777
ReplyDeleteEryaman Alkollü Mekanlar
Kütahya Lojistik
Ordu Parça Eşya Taşıma
Diyarbakır Parça Eşya Taşıma
Tokat Şehir İçi Nakliyat
Antalya Evden Eve Nakliyat
Tokat Parça Eşya Taşıma
Etlik Boya Ustası
Binance Güvenilir mi
C1D74
ReplyDeleteGiresun Parça Eşya Taşıma
Diyarbakır Şehirler Arası Nakliyat
Aydın Şehir İçi Nakliyat
Aksaray Evden Eve Nakliyat
Sincan Parke Ustası
Diyarbakır Lojistik
Bitci Güvenilir mi
Bilecik Şehir İçi Nakliyat
Çerkezköy Asma Tavan
07A82
ReplyDeletehalotestin for sale
order winstrol stanozolol
for sale dianabol methandienone
buy deca durabolin
buy pharmacy steroids
buy anapolon oxymetholone
primobolan
buy testosterone propionat
peptides
01BD8
ReplyDeleteAntalya Lojistik
buy clenbuterol
pharmacy steroids for sale
Aydın Şehirler Arası Nakliyat
order peptides
Van Şehir İçi Nakliyat
Karaman Evden Eve Nakliyat
order fat burner
Kırklareli Şehirler Arası Nakliyat
AFB4C
ReplyDeleteSincan Parke Ustası
Çerkezköy Asma Tavan
Ünye Parke Ustası
Şırnak Evden Eve Nakliyat
Kars Evden Eve Nakliyat
Çerkezköy Sineklik
Sincan Boya Ustası
Silivri Boya Ustası
Amasya Evden Eve Nakliyat
23DE3
ReplyDelete%20 binance komisyon indirimi
2E3D9
ReplyDeleteCoin Çıkarma
Binance Kaldıraçlı İşlem Nasıl Yapılır
Bitcoin Çıkarma Siteleri
Okex Borsası Güvenilir mi
resimlimag.net
Coin Kazanma
Coin Kazma Siteleri
Bitcoin Giriş Nasıl Yapılır
Bitcoin Üretme
F3E31
ReplyDeleteamasya bedava sohbet
diyarbakır rastgele görüntülü sohbet uygulamaları
elazığ goruntulu sohbet
trabzon bedava sohbet siteleri
niğde telefonda kadınlarla sohbet
ucretsiz sohbet
çankırı kadınlarla ücretsiz sohbet
bitlis seslı sohbet sıtelerı
muğla telefonda kadınlarla sohbet
175C1
ReplyDeleteUrfa Sohbet Uygulamaları
aksaray canli sohbet
hatay yabancı görüntülü sohbet uygulamaları
isparta rastgele sohbet uygulaması
elazığ kadınlarla görüntülü sohbet
afyon ücretsiz sohbet
telefonda canlı sohbet
canlı sohbet uygulamaları
edirne mobil sohbet chat
B7AFE
ReplyDeleteTiktok İzlenme Satın Al
Dxy Coin Hangi Borsada
Chat Gpt Coin Hangi Borsada
Hexa Coin Hangi Borsada
Kripto Para Oynama
Referans Kimliği Nedir
Osmo Coin Hangi Borsada
Görüntülü Sohbet Parasız
Binance Hesap Açma
52F01
ReplyDeleteInstagram Beğeni Satın Al
Hexa Coin Hangi Borsada
Hamster Coin Hangi Borsada
Telegram Abone Hilesi
Nonolive Takipçi Satın Al
Threads Takipçi Hilesi
Lunc Coin Hangi Borsada
Snapchat Takipçi Satın Al
Tiktok Takipçi Hilesi
30BF7
ReplyDeletebibox
kripto para telegram
sohbet canlı
binance
papaya meyvesi
binance referans kimliği nedir
bkex
okex
bitcoin haram mı
THJYGJU
ReplyDeleteشركة كشف تسربات المياه بالدمام
شركة تنظيف سجاد بالجبيل HkM2UxbyyC
ReplyDeleteشركة مكافحة حشرات بالهفوف DSuBztaw2b
ReplyDeleteشركة رش حشرات بالاحساء XCkO7nH3sQ
ReplyDeleteشركة مكافحة الحمام بالجبيل CEZonnCOj2
ReplyDeleteرقم المجاري بالاحساء 4G8MjBGnIE
ReplyDelete