Virtual Memory DEMAND PAGING - The avoidance of thrashing was a major research area in the 1970s and led to a vari- ety of complex but effective algorithms.
COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION
With the use of paging, truly effective multiprogramming
systems came into being. Furthermore, the simple tactic of breaking a process up
into pages led to the development of another important concept: virtual memory.
To understand virtual memory, we must add a refinement to the paging
scheme just discussed. That refinement is demand paging, which simply means that
each page of a process is brought in only when it is needed, that is, on demand.
Consider a large process, consisting of a long program plus a number of arrays
of data. Over any short period of time, execution may be confined to a small sec-
tion of the program (e.g., a subroutine), and perhaps only one or two arrays of data
are being used. This is the principle of locality, which we introduced in Appendix
4A. It would clearly be wasteful to load in dozens of pages for that process when
only a few pages will be used before the program is suspended. We can make bet-
ter use of memory by loading in just a few pages. Then, if the program branches
to an instruction on a page not in main memory, or if the program references data
on a page not in memory, a page fault is triggered. This tells the OS to bring in the
desired page.
Thus, at any one time, only a few pages of any given process are in memory,
and therefore more processes can be maintained in memory. Furthermore, time is
saved because unused pages are not swapped in and out of memory. However, the
OS must be clever about how it manages this scheme. When it brings one page in, it
must throw another page out; this is known as page replacement. If it throws out a
page just before it is about to be used, then it will just have to go get that page again
almost immediately. Too much of this leads to a condition known as thrashing: the
processor spends most of its time swapping pages rather than executing instructions.
The avoidance of thrashing was a major research area in the 1970s and led to a vari-
ety of complex but effective algorithms. In essence, the OS tries to guess, based on
recent history, which pages are least likely to be used in the near future.
A discussion of page replacement algorithms is beyond the scope of this chap-
ter. A potentially effective technique is least recently used (LRU), the same algo-
rithm discussed in Chapter 4 for cache replacement. In practice, LRU is difficult to
implement for a virtual memory paging scheme. Several alternative approaches that
seek to approximate the performance of LRU are in use; see Appendix F for details.
With demand paging, it is not necessary to load an entire process into main
memory. This fact has a remarkable consequence: It is possible for a process to be
larger than all of main memory. One of the most fundamental restrictions in pro-
gramming has been lifted. Without demand paging, a programmer must be acutely
aware of how much memory is available. If the program being written is too large,
the programmer must devise ways to structure the program into pieces that can
be loaded one at a time. With demand paging, that job is left to the OS and the
hardware. As far as the programmer is concerned, he or she is dealing with a huge
memory, the size associated with disk storage.
Because a process executes only in main memory, that memory is referred to
as real memory. But a programmer or user perceives a much larger memory—that
which is allocated on the disk. This latter is therefore referred to as virtual memory.
Virtual memory allows for very effective multiprogramming and relieves the user of
the unnecessarily tight constraints of main memory.
Virtual Memory DEMAND PAGING - The avoidance of thrashing was a major research area in the 1970s and led to a vari- ety of complex but effective algorithms.的更多相关文章
- ADDM Reports bug:Significant virtual memory paging was detected on the host operating system
查看ADDM(数据库版本为ORACLE 10.2.0.5.0)报告时,发现其中有个结论非常不靠谱:Significant virtual memory paging was detected on t ...
- Extended paging tables to map guest physical memory addresses from virtual memory page tables to host physical memory addresses in a virtual machine system
A processor including a virtualization system of the processor with a memory virtualization support ...
- Linux Process Virtual Memory
目录 . 简介 . 进程虚拟地址空间 . 内存映射的原理 . 数据结构 . 对区域的操作 . 地址空间 . 内存映射 . 反向映射 .堆的管理 . 缺页异常的处理 . 用户空间缺页异常的校正 . 内核 ...
- Virtual Memory PAGE TABLE STRUCTURE
COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION The basic mechanism f ...
- vmtouch - the Virtual Memory Toucher
https://hoytech.com/vmtouch/ [root@localhost ~]# git clone git://github.com/hoytech/vmtouch.git 正克隆到 ...
- 阿里云 virtual memory exhausted: 无法分配内存
在阿里云买了个云服务器,内存1G.编译php时出现下面的错误: virtual memory exhausted: Cannot allocate memory 问题原因:由于物理内存本身很小,且阿里 ...
- virtual memory exhausted: Cannot allocate memory 解决方法
在阿里云买了个云服务器,内存1G.编译kudu时出现下面的错误: virtual memory exhausted: Cannot allocate memory 问题原因:由于物理内存本身很小,且阿 ...
- 初识virtual memory
一.先谈几个重要的东西 virtual memory是一个抽象概念,书上的原文是"an abstraction of main memory known as virtual memory& ...
- php编译 :virtual memory exhausted: Cannot allocate memory
有时候用vps建站时需要通过编译的方式来安装主机控制面板.对于大内存的VPS来说一般问题不大,但是对于小内存,比如512MB内存的VPS来说,很有可能会出现问题,因为编译过程是一个内存消耗较大的动作. ...
随机推荐
- hdu 4165 dp
可以用卡特兰数做 以下分析转自:http://www.cnblogs.com/kevinACMer/p/3724640.html?utm_source=tuicool 这道题之前自己做的时候并没有反应 ...
- Sonar相关资料
Sonar介绍及安装:http://www.cnblogs.com/suncoolcat/p/3323200.html Sonar安装: http://www.myexception.cn/open- ...
- Android:dimen尺寸资源文件的使用
dimen.xml在values文件夹下面 <resources> <!-- Default screen margins, per the Android Design guide ...
- 编辑WCF配置不出现
在使用VS2010创建
- C#的GC机制(来自网摘复制,未整理)
第一个就是很多人用.Net写程序,会谈到托管这个概念.那么.Net所指的资源托管到底是什么意思,是相对于所有资源,还是只限于某一方面资源?很多人对此不是很了解,其实.Net所指的托管只是针对内存这一个 ...
- DFS HDOJ 2614 Beat
题目传送门 /* 题意:处理完i问题后去处理j问题,要满足a[i][j] <= a[j][k],问最多能有多少问题可以解决 DFS简单题:以每次处理的问题作为过程(即行数),最多能解决n个问题, ...
- ural 1153. Supercomputer
1153. Supercomputer Time limit: 2.0 secondMemory limit: 64 MB To check the speed of JCN Corporation ...
- wp控件
导航控件 Silverlight的Windows Phone应用程序是基于一种可以让用户在不同页面内容间来回导航的页面模型.这个模型是基于其中的frame控件,而页面间的导航就是靠它. 下面的表格列出 ...
- 【wikioi】2495 水叮当的舞步(IDA*)
http://wikioi.com/problem/2495/ 这题我还是看题解啊囧.(搜索实在太弱.完全没想到A*,还有看题的时候想错了,.,- -) 好吧,估价还是那么的简单,判断颜色不同的数目即 ...
- BZOJ4026: dC Loves Number Theory
Description dC 在秒了BZOJ 上所有的数论题后,感觉萌萌哒,想出了这么一道水题,来拯救日益枯 竭的水题资源. 给定一个长度为 n的正整数序列A,有q次询问,每次询问一段区间内所 ...