a glance on memory management in operating system.
this note is useful for those who are keen to know about how the OS works and a brief explanation regarding several terms such
-paging
segmentation
fragmentation
virtual memory
page table
to A Level A2 Computing students, this light note may be helpful for your revision
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
Operating System-Memory Management
1. A GLANCE ON MEMORY
MANAGEMENT SECTION
OPERATING SYSTEM
akmalcikmat
2. Paging
A technique used by virtual memory OS to help
ensure that the data we need is available as quickly
as possible. The operating system copies a certain
number of pages from storage device to main
memory. When a program needs a page that is not in
main memory, the operating system copies the
required page into the memory and copies another
page back to the disk.
akmalcikmat
3. Cont.
One says that the operating system pages the data.
Each time a page is needed that is not currently in
memory, a page fault occurs. An invalid page
fault occurs when the address of the page being
requested is invalid. In this case, the application is
usually aborted
akmalcikmat
4. Segmentation
Segmentation is a technique to break memory into
logical pieces where each piece represents a group of
related information. For example ,data segments or
code segment for each process, data segment for
operating system and so on. Segmentation can be
implemented using or without using paging.
Unlike paging, segment are having varying sizes and
thus eliminates internal fragmentation. External
fragmentation still exists but to lesser extent.
akmalcikmat
6. Fragmentation
Refers to the condition of a disk in which files are
divided into pieces scattered around the disk.
Fragmentation occurs naturally when one use a disk
frequently, creating, deleting, and modifying files. At
some point, the operating system needs to store parts
of a file in non-contiguous clusters. This is entirely
invisible to users, but it can slow down the speed at
which data is accessed because the disk drive must
search through different parts of the disk to put
together a single file.
akmalcikmat
7. Cont.
Fragmentation can also refer to RAM that has
small, unused holes scattered throughout it. This
is called external fragmentation.
With modern OS that use a paging scheme, a
more common type of RAM fragmentation
is internal fragmentation.
This occurs when memory is allocated in frames
and the frame size is larger than the amount of
memory requested
akmalcikmat
9. Virtual Memory
An imaginary memory area supported by some
OSs (for example, Windows but not DOS) in
conjunction with the hardware. One can think of
virtual memory as an alternate set of memory
addresses. Programs use these virtual
addresses rather than real addresses to store
instructions and data. When the program is
actually executed, the virtual addresses are
converted into real memory addresses.
akmalcikmat
12. Page Table
A page table is the data structure used by a
virtual memory system in a computer OS 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.
Each mapping is also known as a page table
entry (PTE)
akmalcikmat
14. Swapping
Swapping is a mechanism in which a process can
be swapped temporarily out of main memory to a
backing store, and then brought back into
memory for continued execution.
Backing store is a usually a hard disk drive or
any other secondary storage which fast in access
and large enough to accommodate copies of all
memory images for all users. It must be capable
of providing direct access to these memory
images
akmalcikmat