Free Essay

Virtual Memory and Paging

In:

Submitted By kakon
Words 621
Pages 3
Undergraduate Program
Bachelor of Computer Science (Systems and Networking)

Advanced Operating Systems
CSNB324

Submitted by:

Mohammad Ali – SN094901

Submitted to:

Dr. Mohd Ezanee
Submission date:

04/08/2015

(a) Virtual memory can be based on Paging only, Segmentation only or a combination of the two. (i)

With the help of a diagram, show how a virtual address is translated into a physical address in a paging-based memory management scheme OR in a segmentation-based memory management scheme.

The mechanism used for reading a word from memory involves the translation of a virtual address consisting of page number and offset into a physical address, consisting of frame number and offset and this translation is done using a page table. Figure 1 shows the structure of paging mechanism. When a particular process is running, a register holds the starting address of the page table for that process. The page number of a virtual address is used to index that table and look up the corresponding frame number. This is combined with the offset portion of the virtual address to produce the desired physical address.

Figure 1: Adress Translation in a paging-based memory management

(ii) What is the memory management technique used in Linux?

Demand paged virtual memory is used as memory management technique in Linux. It is a dynamic memory allocation technique that consists of deferring page frame allocation until the last possible moment which can be the moment when a process attempts to access a page that is not present in RAM. The basic unit of memory allocation for this technique is page and the page size is 212 (4096 bytes or 4KB).

(iii) Every virtual memory reference causes two physical memory accesses - to fetch the appropriate page table entry and to fetch the desired data. Thus, the memory access time is doubled. What solution do the modern computer architectures provide to this problem? Explain and illustrate your answer with a diagram.

Most virtual memory schemes make use of a special high-speed cache for page table entries, usually called a translation lookaside buffer (TLB) to solve the problem of memory access

Figure 2: Use of a Translation Lookaside Buffer

time. This cache functions in the same way as a memory cache and contains the page table entries that have been most recently used. From figure 2 illustrate the use of TLB. Given a

virtual address, the processor will first examine the TLB. If the desired page table entry is present (TLB hit), then the frame number is retrieved and the real address is formed. If the desired page table entry is not found (TLB miss), then the processor uses the page number to index the process page table and examine the corresponding page table entry. If the “present bit” is set, then the page is in main memory, and the processor can retrieve the frame number from the page table entry to form the real address. The processor also updates the TLB to include this new page table entry. Finally, if the present bit is not set, then the desired page is not in main memory and a memory access fault, called a page fault, is issued.
(iv) A system that uses a two-level page table has 212– byte pages and 32-bit virtual addresses. The first 8 bits of the address serve as the index into the first-level page table. 1. How many bits specify the second-level index?
-

(32 – 8 – 12) 12 bits

2. How many entries are in a level-one page table?
-

2^8 entries

3. How many entries are in a level-two page table?
-

2^12 entries

4. How many pages are in the virtual address space?
-

2^20 pages

Similar Documents

Premium Essay

The Benefits and Uses of Virtual Memory

...The Benefits and Uses of Virtual Memory Marcia Amnay POS/355 Steven Kernan April 22nd, 2013 The Benefits and Uses of Virtual Memory This paper will discuss the benefits and uses of virtual memory. Programs require memory to start and run on computers. When several jobs are being processed at the same time, the operating system must keep track of how the computer’s memory and make sure there is enough. Computers come with a limited amount of random access memory which is known as RAM. RAM is the main memory on a computer. If a user is running multiple applications at the same time, the RAM on it will not be enough to execute the processes. This is when virtual memory comes in and balances the process. Virtual memory is a memory management technique. Virtual memory is secondary memory that can act as if it were part of the main memory. When the RAM is used up, virtual memory places data by using the hard disk or another disk of some kind for space. The hard disk is much slower then RAM so the more virtual memory used, the slower your computer will run. The computer will look for areas on the RAM that are not in use and copy it to the hard disk to free up space on the RAM. Virtual memory keeps ‘active’ process in the RAM and keeps the ‘inactive’ processes on the address space on the disk. When an ‘inactive’ process is needed, it will bring that process back to the RAM from the disk. This process is running in the background without the user being aware...

Words: 788 - Pages: 4

Free Essay

Memory Management

...Memory Management: Memory management operations are one of the fundamental core components of an operating system. The memory management function is to organize and manage memory hierarchy of the random access memory, bulky address spaces, memory mapping, manage alternate memory devices, physical allocation, de-allocation of processes, and the computer’s hard drive. Physical address is the address perceived by the memory unit. Virtual memory is the necessity of memory by exploiting the hard drive as additional access memory. What is Memory: An exceptional concept of virtual memory is to present a software application program with the appearance of additional or a considerable amount of memory accessible for its programming use. The virtual memory management system will require mapping functions, which execute address translations converting virtual addresses to physical addresses. The virtual or logical address is the address used to communicate a memory location and physical address is the actual memory location passed to the local memory bus. Paging: In paging, the local address space for both virtual and physical memory is divided into fixed size blocks called pages. The pages can be individually located at different areas in the hard drive and physical memory. The address translation is carried out by the memory management system of the central processing unit. Compare/Contrast: Windows: When running, Windows can access up to four gigabytes of physical memory...

Words: 843 - Pages: 4

Free Essay

80386 Microprocessor

...80386 MICROPROCESSOR It is a 32-bit microprocessor. It has 32 bit data bus and 32 bit address bus, so it can address up to 232 = 4GB of RAM. Features -Multitasking -Memory management -Software protection -Segmentation and paging -Large memory system(64Tbytes in virtual mode) Operating modes -Real mode -Protected mode -Virtual mode Internal architecture: There are 6 parallel functional units: -The bus unit: The bus interface unit provides a 32-bit data bus, a 32-bit address bus and control signals. 8-bit (byte), 16-bit (word) and 32-bit (double word) data transfers are supported. It has separate pins for its address and data bus lines. This processing unit contains the latches and drivers for the address bus, transceivers for the data bus, and control logic for signaling whether a memory input/output, or interrupt acknowledgement bus cycle is to be performed. -The prefetch unit: The prefetch unit performs a mechanism known as an instruction stream queue. This queue permits a prefetch up to 16 bytes (8 memory words) of instruction code which is used by the instruction decoder. Whenever bytes are loaded into the queue they are automatically shifted up through the FIFO to the empty location near the output. -The decode unit: It reads the machine-code instructions from the output side of the prefetch queue and decodes them into microcode instruction format...

Words: 4779 - Pages: 20

Free Essay

Docx

...Lecture
7:
Memory
Management
 CSE
120:
Principles
of
Opera>ng
Systems
 UC
San
Diego:
Summer
Session
I,
2009
 Frank
Uyeda
 Announcements
 •  PeerWise
ques>ons
due
tomorrow.
 •  Project
2
is
due
on
Friday.
 –  Milestone
on
Tuesday
night.
 •  Homework
3
is
due
next
Monday.
 2
 Goals
for
Today
 •  Mo>va>on
for
Memory
Management
 •  Understand
Paging
 –  How
to
translate
from
virtual
to
physical
address
 –  Determine
size,
structure
of
page
tables
 3
 Memory
Management
 •  Goals
of
memory
management
 –  Provide
a
convenient
abstrac>on
for
programming
 –  Allocate
scarce
memory
resources
among
compe>ng
 processes
 –  Maximize
performance
with
minimal
overhead
 •  Mechanisms
 –  Physical
and
virtual
addressing
 –  Techniques:
Par>>oning,
paging,
segmenta>on
 –  Page
table
management,
TLBs,
VM
tricks
 •  Policies
 –  Page
replacement
algorithms
 4
 In
the
beginning…..
 Physical
Memory
 •  Batch
programmed
systems
 –  Programs
use
physical
 addresses
directly
 –  OS
loads
job,
runs
it,
unloads
it
 –  Similar
to
what
nachos
does
 right
now

 Stack
 SP
 Heap
 Data
Segment
 




(you’ll
change
this
in
Project
2)
 PC
 Text
Segment
 Opera>ng
System
 5
 Let
there
be
Mul>programming
 •  Mul>programming
changes
all
of
this
 –  Want
mul>ple
processes
in
memory
at
once
 •  Overlap
I/O
and
CPU
of
mul>ple
jobs
 –  Can
do
it
a
number
of
ways
 •  Fixed
and
variable
par>>oning,
paging,
segmenta>on
 – ...

Words: 1343 - Pages: 6

Premium Essay

Assignment: Noncontiguous Memory Allocation In Memory Management System

...MEMORY MANAGEMENT UNIT Special Assignment(Term Paper) HIMANSHU RATHOD (13BEC176) Electronics & Communication Engineering Institute of Technology Nirma University 13BEC176@nirmauni.ac.in ABSTACT:- In memory management unit we have limited memory so we used virtual memory. Mapping is between pages and frames. Mapping is done by MMU. Processor after dividing the program into pages generates virtual address. Through this mapping we received virtual address of page and by mapping generates the physical address of the frame so we can read the program and execute it.so large program can be executed in small memory. Keywords: MMU;...

Words: 815 - Pages: 4

Free Essay

Fast

...to remove. Run Disk Defragmenter (Start>All Programs>Accessories>System Tools). Increase Virtual Memory... Open Computer Management, click Start, and then click Control Panel. Double-click Administrative Tools, and then double-click Computer Management. XP In the console tree, right-click Computer Management (Local), and then select Properties. On the Advanced tab, click Performance Options, and under Virtual memory, uncheck the check box of Automatically manage paging file size for all drives, click Change. In the Drive list, click the drive that contains the paging file you want to change (usually C:). Under Paging file size for selected drive, type a new paging file size (4095 for both) in the Initial Size and Maximum Size box, and then click Set. Click Apply and OK. Vista/Win 7 1.Open Control Panel>System and Maintenance>System. 2.In the left “Tasks”, click on 'Advanced System Settings'. 3.Click the “Advanced” tab. In “Performance” section, click on 'Settings' button. 4.Click on 'Advanced' tab. 5.In the “Virtual Memory” section, click on 'Change' button. 6.By default, “Automatically manage paging file size for all drives” setting is selected so that Windows Vista system can manage the paging file without user’s interruption. If you want change the paging file size,uncheck the check box of Automatically manage paging...

Words: 401 - Pages: 2

Free Essay

Windows and Linux Memory Management

...Linux Memory Management: Its similarities and difference with Windows’ Memory Management specifically in Page swapping algorithms Abstract Memory management in all the operating system is important because it is crucial for both programming and system administration. In order to make the system faster is that to use an algorithm that saves the time for managing processes and jobs. The article stated the brief discussion on how the Linux memory management works and thus it states that it works almost the same as what the Windows operating system with 32-bit and 64-bit is using. All i/o Linux goes through the page cache and area that caches to improve disk i/o performance same as with the one used in Windows’ cache and Virtual Memory. The paper discussed the difference and similarities of Windows’ memory management and Linux’s Memory Management. It concludes that Linux’s memory management is simpler and easier to maintain compared to Windows’ though, thus Window’s memory management favors the performance and Linux’s having its operating system open sourced, needs improvement through some researches and open sourced programmers. Keywords: Linux, Unix, Page Swapping, Windows, Memory, Virtual Memory, Paging, Placement Policy, Least Recently Used (LRU), Not Recently Used (NRU) Linux Memory Management: Its similarities and difference with Windows’ Memory Management specifically in Page swapping algorithms Operating systems is the heart of all computers may it be...

Words: 1371 - Pages: 6

Free Essay

Memory Management

...Memory management requirements can be broken up into five different sections: Relocation, Protection, Sharing, Local organization, and Physical organization. Many online resources confirm these exact requirements and seem to have the same information published so it is difficult to find something unique. It will be necessary to use information from the referenced textbook to explain memory management requirements. In a multiprogramming system, relocation is the act of moving a process into different areas of memory from which it began. To maximize efficiency, processes move into and out of main memory. Relocation therefore is essential for moving the process into available memory while keeping the memory reference information up to date. Protection of memory is best understood as preventing unwanted access to processes resident in memory and allowing authorized access only to the level allowed when permission is granted. It is important to understand that the physical processor and not the operating system is responsible for protecting memory since the operating system cannot always be scanning for memory reference violations (Stallings, 2012). Sharing capabilities are essential to reduce the amount of wasted or duplicated data in memory. Stallings stated, “The memory management system must therefore allow controlled access to shared areas of memory without compromising essential protection” (p. 309). In addition, shared memory is one of the fastest methods used for interprocess...

Words: 545 - Pages: 3

Free Essay

Oracle Rac

...A white paper prepared with Oracle and IBM technical collaboration March 2010 Oracle Real Application Clusters on IBM AIX Best practices in memory tuning and configuring for system stability Oracle White Paper — Oracle Real Application Clusters on IBM AIX - Best practices for system stability Executive Overview ........................................................................... 2 Introduction ....................................................................................... 2 Problem validation ......................................................................... 3 Examining the AIX Error Logging................................................... 3 Examining the Oracle oprocd logging ............................................ 4 Recommendations for system stability............................................... 5 1. Implement AIX tuning recommendations for Oracle ................... 5 2. Modify Oracle ‘diagwait’ parameter............................................ 6 3. Install the required updates and patches ................................... 8 4. Reduce heavy paging activity. ................................................. 11 Appendix A: Oprocd logging examples ............................................ 14 Clean oprocd log files .................................................................. 14 Oprocd log files showing scheduling delays................................. 14 Oprocd log files after a node reboot or CRS restart .................

Words: 4075 - Pages: 17

Free Essay

Memory Management

...Memory Management Amanda Dyer POS/355 August 28, 2014 August Smith Memory Management Windows and Linux are two popular operating systems used in today’s technology age. Windows is most commonly used as a desktop environment for beginners and has advanced into a well-developed operating system. Linux isn’t every users first choice as an operating system, but has become more and more popular over the past years. Linux is harder to manage than Windows, but comes with a great deal a configuration choices, as well as, flexibility. Both operating systems are similar in areas and offer countless benefits. However, with similarities come differences. One of the foremost differences between Windows and Linux is their memory management. What is memory management? According to Tutorialspoint (2014), memory management is the functionality of an operating system, which handles or manages primary memory. The memory structure affects the overall functionality and speed of the system. Therefore, it is one of the most vital parts of an operating system. Every memory location is tracked, whether free or allocated. The memory management system provides features such as address space, memory mapping, paging, shared virtual memory, fair physical memory allocation, and protection. Windows can access up to 4GB of physical memory on a 32bit x86 system. Paging on Windows allows for the use of a logical memory address vice the physical address. The logical address is translated...

Words: 605 - Pages: 3

Free Essay

Mcitp

...Lab 1.1 Use Task Manager to Monitor a Server Objectives * Monitor a server using Task Manager * Determine which applications, processes, and services are running * Determine the CPU and memory resources used by a server * Monitor network utilization at a NIC * Monitor users on a network Estimated completion time: 20 minutes Activity Background Task Manager is a useful monitoring tool for getting a quick picture of a server. The more you use Task Manager, the more you will get from using it. For instance, you’ll start to know at a glance what is normal for a particular server what is not normal. Such expertise will help you determine, for example, which services should be running the typical performance CPU The Task Manager tabs for monitoring information • Applications—displays currently running applications—lists running processes, as explorer.exe (Windows Explorer) exe (for DNS Server) * Services—lists services and their status, running, stopped, or paused * Performance—displays real-time CPU and memory performance at a glance * Networking—shows real-time network performance in terms of network utilization at all server NICs * User—lists users connected to the server and provides tools to log off or disconnect users, as well as to send users a message Two advantages of Task Manager are that you can start it quickly and it typically requires fewer server re-sources than many other monitoring tools. You...

Words: 4058 - Pages: 17

Free Essay

Memory Management

...Windows and Linux- Memory Management Marlana Muzny POS/355 May 13, 2013 Joe Fischer Windows and Linux- Memory Management Memory management is the process that the operating system takes to manage the computers processes and memory. This means that the operating system has to figure out what sections of the memory are free and are being used at the current time allocating and reallocating as needed. Memory management is extremely important in how a computer operates. In this paper, we will compare the new Windows 8 to the Linux operating system and describe the differences in the memory management. Windows 8, it is the newest product in operating systems for Microsoft. With enhancements from the previous version, Windows 8 makes better use of the memory management than the previous version Windows 7. In Windows 7, Microsoft started making changes to the operating system when it came to memory management; however, fell short compared to what was already being done in Linux operating system. With the previous versions, most of the memory management occurred upon login. This slowed the processor down taking up all the resources at one time using the system memory. To address this issue and correct it in Windows 8, Microsoft implemented a start on demand model. What this means is that processes that are needed are delayed until the process is needed verses having all the processes start automatically when the computer is started. This makes more run...

Words: 876 - Pages: 4

Premium Essay

Evolution of the Universe

...UNIX, Linux, Mac, and Windows OS Comparison Paper B. James Bryant UNIX, Linux, Mac, and Windows OS Comparison In 1956, General Motors produced the first OS for its IBM 704 series mainframe. Since then companies around the world, both big and small, have been tirelessly researched, testing, and releasing newer and faster operating systems for the world to use. Among these are systems developed by/for UNIX, Linux, Microsoft, and Apple. In fact, it’s safe to say that these four companies have a monopoly on all current technology used in both the military, corporate, and private sectors all around the world. UNIX Operating System Unix operating systems have the ability to be multi-user, multi-tasking and portable. Multi-user capabilities are accomplished through time sharing which means the processor allocates slices of time to first one process and then the next, sharing the available time in sequence with waiting processes (Nagpal, 2009). Unix can run in either command line interface, CLI, or graphic user interface or GUI mode. A key and unique feature of Unix is that it has a modular design which allows parts of the system to be added or removed without affecting performance of the other parts making Unix systems highly customizable. Unix operating systems have four core components, (1) the kernel, (2) the shell, (3) the file system, and (4) the utilities or tools and applications (Love et al, 2005). The kernel is the lowest layer of the operating system that...

Words: 5010 - Pages: 21

Free Essay

System Software

...device drivers, memory management, CPU management, and hardware. The operating system is a very critical part of the computer simply because without it, the computer is useless because it cannot function. The operating system manages the computer’s running applications and since each program consists of at least one process, there are typically several processes running at the same time. What the operating system does is manage the computer’s resources in order to run them in an organized manner. This is called scheduling (process scheduling). There are five different states that a process can be in: new, ready, running, waiting, and terminated. The operating system helps the processor organize the processes according to their status in order to keep everything running seamlessly. The operating system operates to keep running programs working and user-ready by making it seem as though several processes are running simultaneously when in fact the available resources are being switched between the processes so quickly that is appears that they are running at the same time. The operating system makes sure that each process has enough memory to execute the process, while also making sure that one process doesn’t interfere with the memory assigned to another process. A computer has four general types of speed: high-speed cache, main memory, secondary memory, and disk storage. The operating system must balance out the need of each process with the different types of memory...

Words: 1369 - Pages: 6

Premium Essay

Memory Management

...Memory Management Federico Torres POS 355 April 9, 2013 CASTLE W. PHELPS, ABD Memory Management “I cannot guarantee that I carry all the facts in my mind. Intense mental concentration has a curious way of blotting out what has passed. Each of my cases displaces the last…”(Doyle, 1901). The way the brain manages memory is metaphorically speaking very similar to the way computers today manage memory. A memory management unit takes a huge part in the speed at which computers can operate. The memory management unit works systematically with the operating system and computer processing unit. There are two different parts to types of memory, primary, also referred to as main, and secondary. The former has two parts, one part for the kernel, which is reserved for the operating system, and the other part for the programs currently being executed. Memory management units must work efficiently in transferring information between primary and secondary. In order for this to succeed, there are a few requirements that memory management units must meet in order to fulfill the demands of users. Memory management units require relocation, protection, sharing, both local and physical organization, among processes in both primary and secondary memory. Two examples of operating systems that meet these requirements, but yet both manage memory differently are Windows and OS X, which is used by Macintosh as an operating system. Since main memory is shared among different types of processes...

Words: 2327 - Pages: 10