当Windows可以访问的总内存也限制为4GB时,Windows如何为每个进程分配4GB的地址空间 [英] How does Windows give 4GB address space each to multiple processes when the total memory it can access is also limited to 4GB

查看:168
本文介绍了当Windows可以访问的总内存也限制为4GB时,Windows如何为每个进程分配4GB的地址空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows如何为多个进程分别提供4GB的地址空间 当它可以访问的总内存也限制为4GB时.

How does Windows give 4GB address space each to multiple processes when the total memory it can access is also limited to 4GB.

我在Windows内存管理中找到上述问题的解决方案 (由Pankaj Garg撰写)

The solution of above question i found in Windows Memory Management (Written by: Pankaj Garg)

解决方案:

要实现此目的,Windows使用了x86处理器(386和 以上)称为分页.分页允许软件使用其他 内存地址(称为逻辑地址)比物理内存 地址.处理器的分页单元将此逻辑地址转换为 物理地址是透明的.这样一来, 系统具有自己的4GB逻辑地址空间.

To achieve this Windows uses a feature of x86 processor (386 and above) known as paging. Paging allows the software to use a different memory address (known as logical address) than the physical memory address. The Processor’ paging unit translates this logical address to the physicals address transparently. This allows every process in the system to have its own 4GB logical address space.

有人可以帮助我以更简单的形式理解它吗?

Can anyone help me to understand it in simpler form?

推荐答案

基本思想是您的物理RAM有限.填满后,您开始将内容存储在硬盘上.当某个进程请求当前在磁盘上的数据或请求新的内存时,您可以通过将其传输到磁盘来从RAM中踢出一页,然后分页实际需要的数据.

The basic idea is that you have limited physical RAM. Once it fills up, you start storing stuff on the hard disk instead. When a process requests data that is currently on disk, or asks for new memory, you kick out a page from RAM by transferring it to the disk, and then page in the data you actually need.

操作系统维护称为页表的数据结构,以跟踪对应的逻辑地址到物理内存中当前的数据以及磁盘上的东西.

The OS maintains a data structure called a page table to keep track of which logical addresses correspond to the data currently in physical memory and where stuff is on the disk.

每个进程都有其自己的虚拟地址空间,并使用该空间内的逻辑地址进行操作.操作系统负责将对给定进程和逻辑地址的请求转换为磁盘上的物理地址/位置.它还负责防止进程访问属于其他进程的内存.

Each process has its own virtual address space, and operates using logical addresses within this space. The OS is responsible for translating requests for a given process and logical address into a physical address/location on disk. It is also responsible for preventing processes from accessing memory that belongs to other processes.

当某个进程请求当前不在物理内存中的数据时,将出现页面错误触发.发生这种情况时,操作系统会选择一个页面移至磁盘(如果物理内存已满).有几种页面替换算法用于选择要踢出的页面.

When a process asks for data that is not currently in physical memory, a page fault is triggered. When this occurs, the OS selects a page to move to disk (if physical memory is full). There are several page replacement algorithms for selecting the page to kick out.

这篇关于当Windows可以访问的总内存也限制为4GB时,Windows如何为每个进程分配4GB的地址空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆