COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION

The simplest scheme for partitioning available memory is to use
fixed-size partitions,
as shown in Figure 8.13. Note that, although the partitions are of fixed size,
they need not be of equal size. When a process is brought into memory, it is placed
in the smallest available partition that will hold it.
 
Even with the use of unequal fixed-size partitions, there will be wasted memory.
In most cases, a process will not require exactly as much memory as provided by
the

partition. For example, a process that requires 3M bytes of memory would be placed
in the 4M partition of Figure 8.13b, wasting 1M that could be used by another process.
 
A more efficient approach is to use variable-size partitions. When a process is
brought into memory, it is allocated exactly as much memory as it requires and no more.
 
 
Example 8.2
An example, using 64 Mbytes of main memory, is shown in Figure 8.14.
Initially, main memory is empty, except for the OS (a). The first three processes are loaded
in, starting where the OS ends and occupying just enough space for each process (b, c, d).
This leaves a “hole” at the end of memory that is too small for a fourth process. At some
point, none of the processes in memory is ready. The OS swaps out process 2 (e), which
leaves sufficient room to load a new process, process 4 (f). Because process 4 is smaller
than process 2, another small hole is created. Later, a point is reached at which none of the
processes in main memory is ready, but process 2, in the Ready-Suspend state, is available.
Because there is insufficient room in memory for process 2, the OS swaps process 1 out (g)
and swaps process 2 back in (h).
 
 
 
As this example shows, this method starts out well, but eventually it leads to a
situation in which there are a lot of small holes in memory. As time goes on, mem-
ory becomes more and more fragmented, and memory utilization declines. One
technique for overcoming this problem is
compaction
: From time to time, the OS
shifts the processes in memory to place all the free memory together in one block.
This is a time-consuming procedure, wasteful of processor time.
 
Before we consider ways of dealing with the shortcomings of partitioning, we
must clear up one loose end. Consider Figure 8.14; it should be obvious that a proc-
ess is not likely to be loaded into the same place in main memory each time it is
swapped in. Furthermore, if compaction is used, a process may be shifted while in
main memory. A process in memory consists of instructions plus data. The instruc-
tions will contain addresses for memory locations of two types:
Addresses of data items
Addresses of instructions, used for branching instruction
 
But these addresses are not fixed. They will change each time a process is
swapped in. To solve this problem, a distinction is made between logical addresses
and physical addresses. A logical address is expressed as a location relative to the
beginning of the program. Instructions in the program contain only logical addresses.
A physical address is an actual location in main memory. When the processor exe-
cutes a process, it automatically converts from logical to physical address by adding
the current starting location of the process, called its base address, to each logical
address. This is another example of a processor hardware feature designed to meet
an OS requirement. The exact nature of this hardware feature depends on the mem-
ory management strategy in use. We will see several examples later in this chapter.

Partitioning的更多相关文章

  1. [LeetCode] Palindrome Partitioning II 拆分回文串之二

    Given a string s, partition s such that every substring of the partition is a palindrome. Return the ...

  2. [LeetCode] Palindrome Partitioning 拆分回文串

    Given a string s, partition s such that every substring of the partition is a palindrome. Return all ...

  3. Leetcode: Palindrome Partitioning II

    参考:http://www.cppblog.com/wicbnu/archive/2013/03/18/198565.html 我太喜欢用dfs和回溯法了,但是这些暴力的方法加上剪枝之后复杂度依然是很 ...

  4. 測試大型資料表的 Horizontal Partitioning 水平切割

    FileGroup 檔案群組 :一個「資料庫(database)」可對應一或多個 FileGroup,一個 FileGroup 可由一或多個 file (.ndf) 構成. FileGroup 可讓 ...

  5. UVA - 11584 Partitioning by Palindromes[序列DP]

    UVA - 11584 Partitioning by Palindromes We say a sequence of char- acters is a palindrome if it is t ...

  6. LintCode Palindrome Partitioning II

    Given a string s, cut s into some substrings such that every substring is a palindrome. Return the m ...

  7. How to Remove Table Partitioning in SQL Server

    In this article we will see how we can remove partitions from a table in a database in SQL server. I ...

  8. Partitioning & Archiving tables in SQL Server (Part 2: Split, Merge and Switch partitions)

    Reference: http://blogs.msdn.com/b/felixmar/archive/2011/08/29/partitioning-amp-archiving-tables-in- ...

  9. Partitioning & Archiving tables in SQL Server (Part 1: The basics)

    Reference: http://blogs.msdn.com/b/felixmar/archive/2011/02/14/partitioning-amp-archiving-tables-in- ...

  10. LeetCode(131)Palindrome Partitioning

    题目 Given a string s, partition s such that every substring of the partition is a palindrome. Return ...

随机推荐

  1. Java Hour 60 逃不开的GC

    第一个大家都应该知道的概念就是应用程序中不断的new 分配了内存,却没有显式的代码去清理内存,而执行这个清理过程的自动垃圾回收的过程就叫做GC. 但是,JVM 说明并没有要求一定要有GC,JVM 说明 ...

  2. poj 3928 树状数组

    题目中只n个人,每个人有一个ID和一个技能值,一场比赛需要两个选手和一个裁判,只有当裁判的ID和技能值都在两个选手之间的时候才能进行一场比赛,现在问一共能组织多少场比赛. 由于排完序之后,先插入的一定 ...

  3. MATLAB信号与系统分析(一)——连续时间信号与系统的时域分析

    一.连续时间信号的表示: 1.向量表示法: 在MATLAB中,是用连续信号在等时间间隔点的样值来近似表示连续信号,当取样时间间隔足够小时,这些离散的样值就能较好地近似出连续信号. 对于连续时间信号f( ...

  4. MATLAB学习笔记(二)——主要是MATLAB的矩阵知识

    PS:主要是讲解矩阵的相应的实现方法,其实MATLAB的很大一部分的优势,就是集成了矩阵级别的运算,并以此为特点,可以进行多维空间上的验证. 让我们懂得了原来线性代数如此有用= - =. (一)MAT ...

  5. 把Chrome浏览器变成文本编辑器

    CoderWall 分享的一个小技巧. 在浏览器地址栏中输入一行代码:data:text/html, <html contenteditable> ,回车即可把浏览器变临时编辑器. 按f1 ...

  6. Loadrunner请求自定义的http(json)文件and参数化

    Loadrunner请求自定义的http(json)文件and参数化      研究啦好些天这个东西啦 终于出来答案啦 嘿嘿 给大家分享一下 : 请求自定义的http文件用函数:web_custom_ ...

  7. 在Windows Server 2008中安装IIS

    1.右键“我的电脑”,选择“管理”,打开“服务器管理器” 2.点击左边菜单栏“角色”调出角色窗口 3.接着点击“添加角色”,弹出添加“角色向导” 4.点击“下一步”进入服务器角色选项 5.勾选“Web ...

  8. json学习系列(8)JSON与JAVA数据的相互转换实例

    一.完整案例 先定义一个java实体对象,如下: package com.pcitc.json.cnblog; /** * SimInfo实体对象 * * @Description * @author ...

  9. String,你到底创建了几个对象????

    String str=new String("aaa"); 这行代码究竟创建了几个String对象呢?答案是2个,而不是3个.由于 new String("aaa&quo ...

  10. Linq To Objects

    一.什么是Linq To Objects 从根本上说,Linq To Objects表示一种新的处理集合的方法.采用旧方法,必须编写指定如何从集合检索数据的复杂的foreach循环.而采用Linq方法 ...