<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>http://wiki.foofun.cn//index.php?action=history&amp;feed=atom&amp;title=Memory_management</id>
	<title>Memory management - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.foofun.cn//index.php?action=history&amp;feed=atom&amp;title=Memory_management"/>
	<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Memory_management&amp;action=history"/>
	<updated>2026-04-05T04:27:17Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.37.1</generator>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=Memory_management&amp;diff=1023&amp;oldid=prev</id>
		<title>2022年3月24日 (四) 13:19 Zhang3</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Memory_management&amp;diff=1023&amp;oldid=prev"/>
		<updated>2022-03-24T13:19:35Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2022年3月24日 (四) 13:19的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l7&quot;&gt;第7行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第7行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===物理地址空间（Physical Address Space）===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===物理地址空间（Physical Address Space）===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;物理地址空间是用于访问RAM中真实位置的直接内存地址。 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;该空间中使用的地址是用于标识地址总线上内存位置的位模式。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;物理地址空间是用于访问RAM中真实位置的直接内存地址。 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;该空间中使用的地址是用于对应于地址总线上内存位置的位模式（bit patterns）。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;在这个内存模型中，每个可执行文件或库都必须使用PIC（位置独立代码-position-independent code），或者随附重新定位表，以便加载器可以调整跳转和分支目标。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;在这个内存模型中，每个可执行文件或库都必须使用PIC（位置独立代码-position-independent code），或者随附重新定位表，以便加载器可以调整跳转和分支目标。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l37&quot;&gt;第37行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第37行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;另一方面，你的“虚拟地址空间”增长到你的CPU和硬盘驱动器可以处理的任何内容。 从概念上讲，CPU缓存和RAM只是在硬盘之上的缓存层，硬盘容量代表了“真正的”内存限制。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;另一方面，你的“虚拟地址空间”增长到你的CPU和硬盘驱动器可以处理的任何内容。 从概念上讲，CPU缓存和RAM只是在硬盘之上的缓存层，硬盘容量代表了“真正的”内存限制。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;页面交换系统依赖于这样的假设，即在给定时间，进程不需要所有内存就能正常工作，只需要其中的一部分即可 (&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;例如，如果您要抄写一本书，则当然不需要整本书和一整套空白页&lt;/del&gt;: &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;如果有人能给你带来新的空白页，并在你缺少空白页时归档你刚刚写的页面，那么只要当前的章节和一堆空白页就足够了， 或者当你快要看完当前的一章时带给你下一章&lt;/del&gt;)。 这被称为 “工作集（working set）” 抽象。 为了正确运行，进程至少需要其正在使用的物理页面工作集： 如果向进程提供的内存页面较少，则存在“抖动”的高风险，这意味着进程将不断要求交换页面——这将迫使此进程工作集中的其他页面在本应保持存在的情况下交换出去。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;页面交换系统依赖于这样的假设，即在给定时间，进程不需要所有内存就能正常工作，只需要其中的一部分即可 (&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;例如，如果你要抄写一本书，则当然不需要整本书和一整套空白页&lt;/ins&gt;: &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;如果有人能给你带来新的空白页，并在你缺少空白页时归档你刚刚写的页面，那么只要当前的章节和一小堆空白页就足够了， 或者当你快要抄完当前的一章时带给你下一章&lt;/ins&gt;)。 这被称为 “工作集（working set）” 抽象。 为了正确运行，进程至少需要其正在使用的物理页面工作集： 如果向进程提供的内存页面较少，则存在“抖动”的高风险，这意味着进程将不断要求交换页面——这将迫使此进程工作集中的其他页面在本应保持存在的情况下交换出去。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    ''注意：页面交换有一些替代方法，如段交换和进程交换。 在这些情况下，交换是由用户软件控制的，这给应用程序开发人员带来了更大的压力，并导致更长的交换时间，因为要交换的逻辑内容会大于4K页面。''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    ''注意：页面交换有一些替代方法，如段交换和进程交换。 在这些情况下，交换是由用户软件控制的，这给应用程序开发人员带来了更大的压力，并导致更长的交换时间，因为要交换的逻辑内容会大于4K页面。''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''其他注意事项：主流桌面操作系统有一种推测性算法，它试图通过加载比需要的更多的页面来减少“页面丢失（page miss）”的频率，并希望这些额外的页面会有用。 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;由于程序往往具有“本地化（localized）”访问的倾向，而且磁盘读取N个扇区的磁道比读取N个独立扇区的磁道快，因此投机性的交换可能会带来好处。&lt;/del&gt;''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''其他注意事项：主流桌面操作系统有一种推测性算法，它试图通过加载比需要的更多的页面来减少“页面丢失（page miss）”的频率，并希望这些额外的页面会有用。 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;由于程序往往具有“本地化（localized）”访问的倾向，而且磁盘读取连续N个扇区的磁道比读取N个独立扇区的磁道快，因此投机性的交换可能会带来好处。&lt;/ins&gt;''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=Memory_management&amp;diff=1022&amp;oldid=prev</id>
		<title>2022年3月24日 (四) 13:08 Zhang3</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Memory_management&amp;diff=1022&amp;oldid=prev"/>
		<updated>2022-03-24T13:08:00Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2022年3月24日 (四) 13:08的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot;&gt;第1行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第1行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''内存管理''' 是任何操作系统[[Kernels | &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;kernel&lt;/del&gt;]]的关键部分。 为程序提供一种定期分配和释放内存的快速方法是内核的主要职责。 [[&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;页面_帧&lt;/del&gt;|&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;分配|物理内存&lt;/del&gt;]]&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;有许多实现，包括位图、伙伴分配和使用树结构或队列&lt;/del&gt;/堆栈。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''内存管理''' 是任何操作系统[[Kernels|&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;内核（kernel）&lt;/ins&gt;]]的关键部分。 为程序提供一种定期分配和释放内存的快速方法是内核的主要职责。 [[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Page_Frame_Allocation&lt;/ins&gt;|&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;分配物理内存&lt;/ins&gt;]]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;有许多实现，包括bitmaps、buddy allocation和使用树结构或队列&lt;/ins&gt;/堆栈。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''有关内存分配模型和分配内存方法的概述，请参阅[[程序内存分配类型]]。 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;如果您正在寻找堆类型的内存管理，即不在大边界上分配较小的内存块，请参阅&lt;/del&gt;[[heap | &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;heap&lt;/del&gt;]]页面。 堆通常（以流行的思维方式）不仅在内核中实现，而且在应用程序中以标准库的形式实现。 有关自动内存管理方法的讨论，请参阅[[垃圾收集]]。''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''有关内存分配模型和分配内存方法的概述，请参阅[[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Program Memory Allocation Types|&lt;/ins&gt;程序内存分配类型]]。 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;如果你正在寻找堆类型的内存管理，即不在大边界上分配较小的内存块，请参阅&lt;/ins&gt;[[heap|&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;堆（heap）&lt;/ins&gt;]]页面。 堆通常（以流行的思维方式）不仅在内核中实现，而且在应用程序中以标准库的形式实现。 有关自动内存管理方法的讨论，请参阅[[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Garbage Collection|&lt;/ins&gt;垃圾收集]]。''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==地址空间==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==地址空间==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;包括x86在内的许多平台都使用内存管理单元（[[MMU]]）来处理虚拟地址空间和物理地址空间之间的转换。 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;一些体系结构具有内置MMU，而其他体系结构具有单独的芯片。 &lt;/del&gt;拥有多个地址空间允许每个任务有自己的内存空间来工作。 在现代系统中，这是内存保护的主要部分。 保持进程的内存空间分开可以使它们在运行时不会在另一个进程的内存空间中造成问题。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;包括x86在内的许多平台都使用内存管理单元（[[MMU&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;|MMU- memory management unit&lt;/ins&gt;]]）来处理虚拟地址空间和物理地址空间之间的转换。 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;一些架构具有内置MMU，而其他架构使用单独的芯片。 &lt;/ins&gt;拥有多个地址空间允许每个任务有自己的内存空间来工作。 在现代系统中，这是内存保护的主要部分。 保持进程的内存空间分开可以使它们在运行时不会在另一个进程的内存空间中造成问题。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;物理地址空间&lt;/del&gt;===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;物理地址空间（Physical Address Space）&lt;/ins&gt;===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;物理地址空间是用于访问RAM中真实位置的直接内存地址。 该空间中使用的地址是用于标识地址总线上内存位置的位模式。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;物理地址空间是用于访问RAM中真实位置的直接内存地址。 该空间中使用的地址是用于标识地址总线上内存位置的位模式。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;在这个内存模型中，每个可执行文件或库都必须使用PIC（位置独立代码），或者随附重新定位表，以便加载器可以调整跳转和分支目标。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;在这个内存模型中，每个可执行文件或库都必须使用PIC（位置独立代码-position-independent code），或者随附重新定位表，以便加载器可以调整跳转和分支目标。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;在早期的680x0 CPU中没有[[MMU]]&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;的情况下，阿米加奥人使用这种内存模型。 &lt;/del&gt;它是最有效的，但它不允许进程之间相互保护，因此在今天的桌面操作系统中被认为是过时的。 它也容易出现内存碎片；然而，某些嵌入式系统仍然使用它。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;在早期的680x0 CPU中没有[[MMU]]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;的情况下，AmigaOS使用这种内存模型。 &lt;/ins&gt;它是最有效的，但它不允许进程之间相互保护，因此在今天的桌面操作系统中被认为是过时的。 它也容易出现内存碎片；然而，某些嵌入式系统仍然使用它。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;虚拟地址空间&lt;/del&gt;===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;虚拟地址空间（Virtual Address Space）&lt;/ins&gt;===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[MMU]]&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;s（内存管理单元）的出现允许使用虚拟地址。 &lt;/del&gt;虚拟地址可以映射到任何物理地址。 可以为每个可执行文件提供自己的地址空间，以便内存始终从0x0000 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;0000开始。这减轻了可执行加载程序的一些重新定位工作，并解决了内存碎片问题—您不再需要物理上连续的内存块。 &lt;/del&gt;由于内核控制着虚拟到物理的映射，进程不能访问彼此的内存，除非内核允许这样做。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[MMU]]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;（内存管理单元）的出现允许使用虚拟地址。 &lt;/ins&gt;虚拟地址可以映射到任何物理地址。 可以为每个可执行文件提供自己的地址空间，以便内存始终从0x0000 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;0000开始。这减轻了可执行加载程序的一些重新定位工作，并解决了内存碎片问题—你不再需要物理上连续的内存块。 &lt;/ins&gt;由于内核控制着虚拟到物理的映射，进程不能访问彼此的内存，除非内核允许这样做。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;记忆翻译系统&lt;/del&gt;==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;内存转换系统（Memory Translation Systems）&lt;/ins&gt;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;x86平台在现代计算机系统中是独一无二的，因为它有两种方法来处理虚拟地址和物理地址之间的映射。 分页和分段这两种方法都使用非常不同的系统来管理内存映射。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;x86平台在现代计算机系统中是独一无二的，因为它有两种方法来处理虚拟地址和物理地址之间的映射。 分页和分段这两种方法都使用非常不同的系统来管理内存映射。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===分段===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===分段===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Main|Segmentation}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Main|Segmentation}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;除x86外，主流系统中通常不提供分段功能。在保护模式下，此方法涉及将进程的每个内存区域划分为多个单元。 这由[[&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;CPU寄存器x86&lt;/del&gt;#段寄存器|段寄存器]]处理：''CS、DS、SS、ES、FS、GS''&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;（代码段、数据段、堆栈段，其余为外段）。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;除x86外，主流系统中通常不提供分段功能。在保护模式下，此方法涉及将进程的每个内存区域划分为多个单元。 这由[[&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;CPU Registers x86&lt;/ins&gt;#段寄存器|段寄存器]]处理：&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;''&lt;/ins&gt;''CS、DS、SS、ES、FS、GS''&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;''（代码段、数据段、堆栈段，其余为额外段）。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===分页===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===分页===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Main|Paging}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{Main|Paging}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;当然，为每个地址单独设置虚拟到物理的映射是无效的。 虚拟内存的传统方法是将可用的物理内存拆分为块（页），并“逐页”将虚拟地址映射到物理地址。此任务主要由[[MMU]]&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;处理，因此对性能的影响很小，并且通常被认为是支付内存保护的适当价格。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;当然，为每个地址单独设置虚拟到物理的映射是无效的。 虚拟内存的传统方法是将可用的物理内存拆分为块（页），并“逐页”将虚拟地址映射到物理地址。此任务主要由[[MMU]]&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;处理，因此对性能的影响很小，并且通常被认为是支付内存保护的适当付出。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Image:Virtual memory.png|frame|none|&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;paging illustrated: two process with different views of the same physical memory&lt;/del&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;[[Image:Virtual memory.png|frame|none|&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;分页说明：两个进程对同一物理内存有不同的视图&lt;/ins&gt;]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==虚拟内存==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==虚拟内存==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l33&quot;&gt;第33行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第33行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;下一步不是在物理内存用完后报告“内存不足”，而是获取当前未实际访问的页面，并将其写入硬盘（交换文件或分区）——释放物理内存页面。 This is referred to as &amp;quot;paging out&amp;quot; memory.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;下一步不是在物理内存用完后报告“内存不足”，而是获取当前未实际访问的页面，并将其写入硬盘（交换文件或分区）——释放物理内存页面。 This is referred to as &amp;quot;paging out&amp;quot; memory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;这需要额外的簿记和调度，当进程访问当前已调出且必须从硬盘重新调出的页面时，会导致严重的性能损失，并且需要一些智能设计才能有效运行。 如果做得不对，操作系统的这一部分会“严重”影响您的性能。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;这需要额外的记录和调度，当进程访问当前已调出且必须从硬盘重新调出的页面时，会导致严重的性能损失，并且需要一些智慧设计才能有效运行。 如果做得不对，操作系统的这一部分会“严重”影响你的性能。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;另一方面，您的“虚拟地址空间”增长到您的CPU和硬盘驱动器可以处理的任何内容。 从概念上讲，CPU缓存和RAM只是成为硬盘顶部的缓存层，这代表了“真正的”内存限制。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;另一方面，你的“虚拟地址空间”增长到你的CPU和硬盘驱动器可以处理的任何内容。 从概念上讲，CPU缓存和RAM只是在硬盘之上的缓存层，硬盘容量代表了“真正的”内存限制。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;页面交换系统依赖于这样一种假设，即在给定时间，进程不需要所有内存才能正常工作，但只是其中的一小部分（比如，如果你在复制一本书，你当然不需要整本书和一整套空白页：如果有人能给你带来新的空白页，并将你刚写的空白页归档，或者在你几乎用完cur时给你带来下一章，那么当前章节和一堆空白页就足够了。）租一间）。这被称为“工作集”抽象。 为了正确运行，流程至少需要其物理页面的工作集：如果向流程提供的页面较少，则存在“抖动”的高风险，这意味着该进程将不断地要求交换页面——这将迫使该进程工作集中的其他页面在本应保持存在的情况下被交换出去。&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;页面交换系统依赖于这样的假设，即在给定时间，进程不需要所有内存就能正常工作，只需要其中的一部分即可 (例如，如果您要抄写一本书，则当然不需要整本书和一整套空白页: 如果有人能给你带来新的空白页，并在你缺少空白页时归档你刚刚写的页面，那么只要当前的章节和一堆空白页就足够了， 或者当你快要看完当前的一章时带给你下一章)。 这被称为 “工作集（working set）” 抽象。 为了正确运行，进程至少需要其正在使用的物理页面工作集： 如果向进程提供的内存页面较少，则存在“抖动”的高风险，这意味着进程将不断要求交换页面——这将迫使此进程工作集中的其他页面在本应保持存在的情况下交换出去。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    ''注意：页面交换有一些替代方法，如段交换和进程交换。 &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;在这些情况下，交换是由用户软件控制的，这给应用程序开发人员带来了更大的压力，并导致更长的交换时间，因为要交换的逻辑内容大于4K页面。&lt;/del&gt;''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;    ''注意：页面交换有一些替代方法，如段交换和进程交换。 &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;在这些情况下，交换是由用户软件控制的，这给应用程序开发人员带来了更大的压力，并导致更长的交换时间，因为要交换的逻辑内容会大于4K页面。&lt;/ins&gt;''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;其他注意事项：主流桌面操作系统有一种推测性算法，它试图通过加载比需要的更多的页面来减少“页面丢失”的频率，并希望这些额外的页面会有用。 由于程序往往具有“本地化”访问，而且磁盘读取N个扇区的磁道比读取N个独立扇区的磁道快，因此投机交换可能会带来好处。&lt;/del&gt;''&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;''&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;其他注意事项：主流桌面操作系统有一种推测性算法，它试图通过加载比需要的更多的页面来减少“页面丢失（page miss）”的频率，并希望这些额外的页面会有用。 由于程序往往具有“本地化（localized）”访问的倾向，而且磁盘读取N个扇区的磁道比读取N个独立扇区的磁道快，因此投机性的交换可能会带来好处。&lt;/ins&gt;''&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;/blockquote&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l55&quot;&gt;第55行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第55行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*[[Brendan's Memory Management Guide]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*[[Brendan's Memory Management Guide]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;话题&lt;/del&gt;===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;===&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;论坛主题&lt;/ins&gt;===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*[[topic:12307|Paging Mechanisms]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*[[topic:12307|Paging Mechanisms]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*[[topic:12022|Paging Concepts (by Brendan)]]&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;*[[topic:12022|Paging Concepts (by Brendan)]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
	<entry>
		<id>http://wiki.foofun.cn//index.php?title=Memory_management&amp;diff=62&amp;oldid=prev</id>
		<title>Zhang3：创建页面，内容为“'''内存管理''' 是任何操作系统 kernel的关键部分。 为程序提供一种定期分配和释放内存的快速方法是内核的主要职责。 物理内存有许多实现，包括位图、伙伴分配和使用树结构或队列/堆栈。  ''有关内存分配模型和分配内存方法的概述，请参阅程序内存分配类型。 如果您正在寻找堆类型的内存管理，即不在大边界上分配…”</title>
		<link rel="alternate" type="text/html" href="http://wiki.foofun.cn//index.php?title=Memory_management&amp;diff=62&amp;oldid=prev"/>
		<updated>2021-12-21T06:20:41Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“&amp;#039;&amp;#039;&amp;#039;内存管理&amp;#039;&amp;#039;&amp;#039; 是任何操作系统&lt;a href=&quot;/index.php?title=Kernels&quot; class=&quot;mw-redirect&quot; title=&quot;Kernels&quot;&gt; kernel&lt;/a&gt;的关键部分。 为程序提供一种定期分配和释放内存的快速方法是内核的主要职责。 &lt;a href=&quot;/index.php?title=%E9%A1%B5%E9%9D%A2_%E5%B8%A7&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;页面 帧（页面不存在）&quot;&gt;分配|物理内存&lt;/a&gt;有许多实现，包括位图、伙伴分配和使用树结构或队列/堆栈。  &amp;#039;&amp;#039;有关内存分配模型和分配内存方法的概述，请参阅&lt;a href=&quot;/index.php?title=%E7%A8%8B%E5%BA%8F%E5%86%85%E5%AD%98%E5%88%86%E9%85%8D%E7%B1%BB%E5%9E%8B&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;程序内存分配类型（页面不存在）&quot;&gt;程序内存分配类型&lt;/a&gt;。 如果您正在寻找堆类型的内存管理，即不在大边界上分配…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''内存管理''' 是任何操作系统[[Kernels | kernel]]的关键部分。 为程序提供一种定期分配和释放内存的快速方法是内核的主要职责。 [[页面_帧|分配|物理内存]]有许多实现，包括位图、伙伴分配和使用树结构或队列/堆栈。&lt;br /&gt;
&lt;br /&gt;
''有关内存分配模型和分配内存方法的概述，请参阅[[程序内存分配类型]]。 如果您正在寻找堆类型的内存管理，即不在大边界上分配较小的内存块，请参阅[[heap | heap]]页面。 堆通常（以流行的思维方式）不仅在内核中实现，而且在应用程序中以标准库的形式实现。 有关自动内存管理方法的讨论，请参阅[[垃圾收集]]。''&lt;br /&gt;
&lt;br /&gt;
==地址空间==&lt;br /&gt;
包括x86在内的许多平台都使用内存管理单元（[[MMU]]）来处理虚拟地址空间和物理地址空间之间的转换。 一些体系结构具有内置MMU，而其他体系结构具有单独的芯片。 拥有多个地址空间允许每个任务有自己的内存空间来工作。 在现代系统中，这是内存保护的主要部分。 保持进程的内存空间分开可以使它们在运行时不会在另一个进程的内存空间中造成问题。&lt;br /&gt;
&lt;br /&gt;
===物理地址空间===&lt;br /&gt;
物理地址空间是用于访问RAM中真实位置的直接内存地址。 该空间中使用的地址是用于标识地址总线上内存位置的位模式。&lt;br /&gt;
&lt;br /&gt;
在这个内存模型中，每个可执行文件或库都必须使用PIC（位置独立代码），或者随附重新定位表，以便加载器可以调整跳转和分支目标。&lt;br /&gt;
&lt;br /&gt;
在早期的680x0 CPU中没有[[MMU]]的情况下，阿米加奥人使用这种内存模型。 它是最有效的，但它不允许进程之间相互保护，因此在今天的桌面操作系统中被认为是过时的。 它也容易出现内存碎片；然而，某些嵌入式系统仍然使用它。&lt;br /&gt;
&lt;br /&gt;
===虚拟地址空间===&lt;br /&gt;
[[MMU]]s（内存管理单元）的出现允许使用虚拟地址。 虚拟地址可以映射到任何物理地址。 可以为每个可执行文件提供自己的地址空间，以便内存始终从0x0000 0000开始。这减轻了可执行加载程序的一些重新定位工作，并解决了内存碎片问题—您不再需要物理上连续的内存块。 由于内核控制着虚拟到物理的映射，进程不能访问彼此的内存，除非内核允许这样做。&lt;br /&gt;
&lt;br /&gt;
==记忆翻译系统==&lt;br /&gt;
x86平台在现代计算机系统中是独一无二的，因为它有两种方法来处理虚拟地址和物理地址之间的映射。 分页和分段这两种方法都使用非常不同的系统来管理内存映射。&lt;br /&gt;
&lt;br /&gt;
===分段===&lt;br /&gt;
{{Main|Segmentation}}&lt;br /&gt;
除x86外，主流系统中通常不提供分段功能。在保护模式下，此方法涉及将进程的每个内存区域划分为多个单元。 这由[[CPU寄存器x86#段寄存器|段寄存器]]处理：''CS、DS、SS、ES、FS、GS''（代码段、数据段、堆栈段，其余为外段）。&lt;br /&gt;
&lt;br /&gt;
===分页===&lt;br /&gt;
{{Main|Paging}}&lt;br /&gt;
当然，为每个地址单独设置虚拟到物理的映射是无效的。 虚拟内存的传统方法是将可用的物理内存拆分为块（页），并“逐页”将虚拟地址映射到物理地址。此任务主要由[[MMU]]处理，因此对性能的影响很小，并且通常被认为是支付内存保护的适当价格。&lt;br /&gt;
&lt;br /&gt;
[[Image:Virtual memory.png|frame|none|paging illustrated: two process with different views of the same physical memory]]&lt;br /&gt;
&lt;br /&gt;
==虚拟内存==&lt;br /&gt;
&lt;br /&gt;
下一步不是在物理内存用完后报告“内存不足”，而是获取当前未实际访问的页面，并将其写入硬盘（交换文件或分区）——释放物理内存页面。 This is referred to as &amp;quot;paging out&amp;quot; memory.&lt;br /&gt;
&lt;br /&gt;
这需要额外的簿记和调度，当进程访问当前已调出且必须从硬盘重新调出的页面时，会导致严重的性能损失，并且需要一些智能设计才能有效运行。 如果做得不对，操作系统的这一部分会“严重”影响您的性能。&lt;br /&gt;
&lt;br /&gt;
另一方面，您的“虚拟地址空间”增长到您的CPU和硬盘驱动器可以处理的任何内容。 从概念上讲，CPU缓存和RAM只是成为硬盘顶部的缓存层，这代表了“真正的”内存限制。&lt;br /&gt;
&lt;br /&gt;
页面交换系统依赖于这样一种假设，即在给定时间，进程不需要所有内存才能正常工作，但只是其中的一小部分（比如，如果你在复制一本书，你当然不需要整本书和一整套空白页：如果有人能给你带来新的空白页，并将你刚写的空白页归档，或者在你几乎用完cur时给你带来下一章，那么当前章节和一堆空白页就足够了。）租一间）。这被称为“工作集”抽象。 为了正确运行，流程至少需要其物理页面的工作集：如果向流程提供的页面较少，则存在“抖动”的高风险，这意味着该进程将不断地要求交换页面——这将迫使该进程工作集中的其他页面在本应保持存在的情况下被交换出去。&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
   ''注意：页面交换有一些替代方法，如段交换和进程交换。 在这些情况下，交换是由用户软件控制的，这给应用程序开发人员带来了更大的压力，并导致更长的交换时间，因为要交换的逻辑内容大于4K页面。''&lt;br /&gt;
&lt;br /&gt;
''其他注意事项：主流桌面操作系统有一种推测性算法，它试图通过加载比需要的更多的页面来减少“页面丢失”的频率，并希望这些额外的页面会有用。 由于程序往往具有“本地化”访问，而且磁盘读取N个扇区的磁道比读取N个独立扇区的磁道快，因此投机交换可能会带来好处。''&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==另见==&lt;br /&gt;
&lt;br /&gt;
===文章===&lt;br /&gt;
*[[Detecting Memory (x86)]]&lt;br /&gt;
*[[Garbage collection]]&lt;br /&gt;
*[[Memory Allocation]]&lt;br /&gt;
*[[Page Frame Allocation]]&lt;br /&gt;
*[[Writing a memory manager]] - a tutorial&lt;br /&gt;
*[[Brendan's Memory Management Guide]]&lt;br /&gt;
&lt;br /&gt;
===话题===&lt;br /&gt;
*[[topic:12307|Paging Mechanisms]]&lt;br /&gt;
*[[topic:12022|Paging Concepts (by Brendan)]]&lt;br /&gt;
*[[topic:22661|Paging Explained (by Creature)]]&lt;br /&gt;
&lt;br /&gt;
===外部链接===&lt;br /&gt;
*[http://www.amd.com/us-en/Processors/DevelopWithAMD/0,,30_2252_739_7044,00.html AMD Systems Programming Documentation] Chapters 3 &amp;amp; 4 of Volume 2&lt;br /&gt;
*[http://www.intel.com/products/processor/manuals/ Intel Systems Programming Documentation] Chapters 3 &amp;amp; 4 of Volume 3A&lt;br /&gt;
*[http://linux-mm.org/ LinuxMM] - 记录内存管理项目和开发的wiki&lt;br /&gt;
*[http://www.osdever.net/tutorials/index#Memory-Management Memory Management Articles] - 关于内存管理的真正操作系统开发教程&lt;br /&gt;
*[[wikipedia:Memory management | Memory management]] on Wikipedia.&lt;br /&gt;
*[http://duartes.org/gustavo/blog/post/motherboard-chipsets-memory-map Jun 2008: Motherboard Chipsets and the Memory Map] by Gustavo Duarte&lt;br /&gt;
*[http://duartes.org/gustavo/blog/post/anatomy-of-a-program-in-memory Jan 2009: Anatomy of a Program in Memory] by Gustavo Duarte&lt;br /&gt;
&lt;br /&gt;
[[Category:Memory management]]&lt;br /&gt;
[[de:Speicherverwaltung]]&lt;/div&gt;</summary>
		<author><name>Zhang3</name></author>
	</entry>
</feed>