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来说,很有可能会出现问题,因为编译过程是一个内存消耗较大的动作. ...
随机推荐
- PHP 5.4中的traits特性
Trait 是 PHP5. 中的新特性,是 PHP 多重继承的一种解决方案.例如,需要同时继承两个 Abstract Class, 这将会是件很麻烦的事情,Trait 就是为了解决这个问题. 简单使用 ...
- jdbc、事务(Transaction)、批处理 回顾
论文写的头疼,回顾一下jdbc,换换脑子 传统的写法: 1.加载驱动类 class.forname("jdbc类的包结构"); 2.获得连接 Connection conn=Dri ...
- php二位数组合并
转自:http://www.cnblogs.com/losesea/archive/2013/06/14/3134900.html 题目:有以下2个二维数组 1$a=Array(0 => Arr ...
- PDA移动POS开单扫描打票收银系统-带来零售批发 新的技术 新的手段!!
手持POS终端高清彩屏,清晰.美观.大方,适用于仓库.超市.服装.食品.批发零售.手机电脑等企业管理.可与管理软件灵活对接.1:员工记不住价格,产品名称,只要有PDA扫描,价格,库存,直接开销售单,打 ...
- 简单几何(求交点) UVA 11437 Triangle Fun
题目传送门 题意:三角形三等分点连线组成的三角形面积 分析:入门题,先求三等分点,再求交点,最后求面积.还可以用梅涅劳斯定理来做 /********************************** ...
- HDU4859 海岸线(最小割)
题目大概就是说一个n*m的地图,地图上每一块是陆地或浅海域或深海域,可以填充若干个浅海域使其变为陆地,问能得到的最长的陆地海岸线是多少. 也是很有意思的一道题. 一开始想歪了,想着,不考虑海岸线重合的 ...
- 核反应堆[HDU2085]
核反应堆 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submis ...
- NOI2010 : 超级钢琴
求出前缀和 对于每个结尾i,设现在取的区间是[j+1,i],则i-R<=j<=i-L,取出该区间sum[j]的最小值,将sum[i]-sum[j]放入堆中 建立一个大根堆,每次取出堆顶元素 ...
- BZOJ3834 : [Poi2014]Solar Panels
问题相当于找到一个最大的k满足在$[x_1,x_2]$,$[y_1,y_2]$中都有k的倍数 等价于$\frac{x_2}{k}>\frac{x_1-1}{k}$且$\frac{y_2}{k}& ...
- 精通CSS :nth-child伪类
:nth-child 基本用法 :nth-child:nth-child(8) 选中第8个子元素 li:nth-child(8) span { background-color: #298EB2; b ...