本文介绍了如果物理内存的大小为2 ^ 32-1,那么虚拟内存的大小是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道物理地址的长度为32位,但是如何通过此信息找出虚拟内存的大小?

I know that physical address will be 32 bits long but how do I find out the size of virtual memory by this information?

推荐答案

在x86上,虚拟内存地址空间的总大小为2 ^ 32,在x64上更大(当前大约为2 ^ 48).但是,操作系统通常会保留此空间的一部分,因此32位应用程序不一定必须立即处理4GB.另外,操作系统可以轻松地将不同的内存进出交换,因此,如果需要,可以通过一种银行切换的方式在操作系统的协助下支持超过4GB的内存,通过告诉它在您要访问内存时修改页表来实现.当前未映射到您的地址空间.

The total size of the virtual memory address space is 2^32 on x86 and much larger (currently around 2^48) on x64. However, the OS usually reserves a portion of this space, so a 32bit app can't necessarily address 4gb at once. Also, the OS can easily swap different pieces of memory in and out, so if necessary, more than 4gb could be supported with assistance of the OS through a form of bank switching by telling it to modify your page tables when you want to access memory that isn't currently mapped into your address space.

此外,支持的最大物理内存量不一定是2 ^ 32.甚至32位计算机也通常通过PSE36或PAE最多支持2 ^ 36.

Also, the maximum amount of physical memory supported is not necessarily 2^32. Even 32bit machines often support up to 2^36 through PSE36 or PAE.

这篇关于如果物理内存的大小为2 ^ 32-1,那么虚拟内存的大小是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-27 00:58