Jun 15

32位系统能管理多大内存? 不指定

@ 2008-6-15 16:19 [IT » 操作系统] 评论(0) , 引用(0) , 阅读(9102) | Via 本站原创 | |
(看到一些关于操作系统内存管理以及32位系统到底能访问多少内存的讨论,觉得比较有价值,放上来。)

32位系统能管理多大内存?
以前一直以为是4GB,认为大于4G的内存操作系统和应用软件都没办法利用,今天看到这些讨论,才发现原来不是的,就像当年DOS可以访问大于1M的内存一样,通过PAE,Win32也可以访问大于4GB的内存。

这样的话一些对内存消耗较大的程序可以通过AWE来利用那些“多出来”的内存,或者甚至可以做一个内存映射软件将一部分应用程序的内存空间映射到那大于4GB的空间去,这样我们就不用担心自己主板上插了大于4G的内存在32位系统下用不了啦(当然前提是主板得支持大于4G的内存)



以下转自CSDN的讨论帖:http://topic.csdn.net/u/20080614/15/C1FDC87A-8CF2-44E6-A56A-A2F5CDD05555.html
整理by sandy_zc_1



wooyz 发表于:2008-06-14 15:19:01

从MSDN上看到,PAE和AWE的相关资料。
感觉看得不是很明白。

疑问:
1。按照下文所述,如果不是Windows Server 2003 Enterprise Edition Windows Advanced Server, Limited Edition
Windows 2000 Datacenter Server ,Windows 2000 Advanced Server 则无法使用PAE功能,那么是否意味着应用程序最大只能访问4GB的物理内存?
2。下文中,memory和physical memory究竟指的是什么概念?
3。按照下文所述,对于AWE,如果不支持PAE,则AWE无法预留大于4GB的物理内存。假设在没有使能PAE的情况下,物理内存有8GB,那么对于一个进程来说,该进程最大可以预留多少物理内存呢?4GB?该进程最大可以使用的内存有多少呢?4GB(扩展)+2GB(工作区)?

望各位大牛斧正!




Physical Address Extension
The Physical Address Extension (PAE) enables applications to address more than 4 GB of physical memory. It is supported by Intel processors. The following systems can use PAE to take advantage of physical memory beyond 4 GB:


Windows Server 2003 Enterprise Edition
Windows Advanced Server, Limited Edition
Windows 2000 Datacenter Server
Windows 2000 Advanced Server
To enable PAE, you must use the /PAE switch in the Boot.ini file.

With PAE enabled, the operating system moves from two-level linear address translation to three-level address translation. The extra layer of translation provides access to physical memory beyond 4 GB. Instead of a linear address being split into three separate fields for indexing into memory tables, it is split into four separate fields; a 2-bit field, two 9-bit fields, and a 12-bit field that corresponds to the page size implemented by Intel Architecture (4 KB).

Typically, a process can access up to 2 GB of memory address space (assuming the /3GB switch was not used), with some of the memory being physical memory and some being virtual memory. The memory manager uses PAE to provide more physical memory to an application, which reduces the need to swap memory to the page file and increases performance. The application itself is not aware of the actual memory size. All of the memory management and allocation of the PAE memory is handled by the memory manager independently of the application.

Applications that are 4GT-aware are likely to remain in physical memory rather than be paged out, which increases their performance. The exception is when the /3GB switch is used in conjunction with the /PAE switch. In this case, the operating system does not use any memory in excess of 16 GB. Therefore, if the system restarts with the /3GB entry in the Boot.ini file, and the system has more than 16 GB of physical memory, the additional physical random access memory (RAM) is not used by the operating system. Restarting the computer without the /3GB switch enables the use of all of the physical memory.

Address Windowing Extensions (AWE) enables applications to address more than 4 GB. AWE enables an application to reserve physical memory as nonpaged memory, then dynamically map portions of the nonpaged memory to its working set. This enables memory-intensive programs to reserve large amounts of physical memory for data without swapping to disk. Instead, the data is swapped between the working set and reserved memory above the 4 GB range. The memory above 4 GB is exposed to the memory manager and the AWE functions by PAE. Without PAE, AWE is unable to reserve memory in excess of 4 GB.


-----------------------------------------------------------------------------

yxz_lp  发表于:2008-06-14 16:22:56

1)不对,可以打开MMC控制台,在计算机策略里添加Lock Page in Memory权限,就可以使用AWE,至少在我的计算机(WinXP SP2)里是可以的。
2)memory是内存的统称,包括Physical memory、Virtual memory,Physical memory特指在RAM中的内存(物理内存)。
3)4GB其中2GB为用户区,当然可以用/3GB开关来扩展到3GB用户区。AWE可以突破4GB限制,AWE的目的就是允许应用程序对从来不在操作系统与磁盘之间交换的RAM进行分配;允许应用程序访问的RAM大于进程的地址空间。AWE相关的函数:AllocateUserPhysicalPages、 MapUserPhysicalPages、FreeUserPhysicalPages


---------------------------------------------------------------------------

sd9phoenix  发表于:2008-06-14 16:25:21

1.准确讲是3G多点,系统会把超过3G以上容量的内存优先分配给其他负责输入/输出的物理设备,从而导致实际上可使用的内存不足4G,这既受限于芯片组寻址能力,又受限于系统本身。只有在965以后的主板上,开启“Memory Remap(该功能可使中断的代码在不同的存储空间运行)”选项并且安装64位的xp/vista,才可以正确访问超过3G的内存;
2.memory:一个大概念——内存;
physical memory:一个小概念——物理内存,就是电脑内存条的存储空间;
免费奉送一个 virtual memory:虚拟内存,磁盘驱动器上映射出来的存储转换空间;
3.不讨论了,普通用户没那么大的进程……其实到底支持多大内存,不全是系统说了算,主板也很关键,而且PAE开关也不是万能的,得看硬件支不支持PAE。



---------------------------------------------------------------------------

wooyz 发表于:2008-06-14 19:43:36

可不可以这么理解,AWE事实上,是把系统中空闲的物理内存据为己有(本线程)。
而这个允许据为己有的部分的最大值受PAE的限制(当然,我们不考虑主板的约束),
如果PAE打开,则该AWE可以管理的内存将允许大于4GB;
如果PAE没打开,则该AWE可以管理的内存最大为4GB;  




----------------------------------------------------------------------------

wooyz 发表于:2008-06-14 19:56:29

另问:
对于64位的操作系统,PAE功能是否已经变得没有意义呢?
对于32位的操作系统,PAE呢?

总是觉得这中间有什么地方没有理解到位。

狂郁闷……  


------------------------------------------------------------------------------

wooyz 发表于:2008-06-15 09:50:16

困扰我的疑惑,这句话也许就是答案:
“系统及应用程序都能利用这些‘多’出的内存。 对于XP,2000 pro这些最多只能管理4GB的操作系统,大内存其实并没有浪费,应用程序可以调用AWE(通过PAE)来使用这些内存,自己作映射了。”

附录:摘至http://vs2.it.com.cn/articles/243328.htm

Windows可管理的最大内存和Windows程序(进程)可寻址的最大空间是两个不同的概念。32位的程序最大只能寻址4GB,其中用户模式占2GB,内核占2GB。 这里的内存是Windows的虚拟内存空间,其实包括了物理内存和页面文件。因为系统内存有限,而每个进程都假设自己获得4GB的空间,所以每个进程的真实内存空间一部分在物理内存中,一部分在被交换到页面文件中。 那个boot.ini里面的/3GB参数,实际上修改的是4GB的内存分配模式,3GB给了用户模式,1GB给了内核,让应用程序能用到跟大的空间。

Windows所能管理的空间,是另一个概念。同样是32位的系统,Windows 2003 Std可管理4GB,而Enterprose就可以管理32GB。这并不奇怪, 系统在自动调配内存自由,通过的其实就是PAE,就如当年DOS下通过EMS,XMS突破1M的访问空间。 PAE也是在内存中开了一个窗口,把超出4GB的内存,映射到4GB的范围中,而应用程序的使用则是透明的。对于能管理大于4GB的操作系统,PAE是自动打开的。 系统及应用程序都能利用这些‘多’出的内存。 对于XP,2000 pro这些最多只能管理4GB的操作系统,大内存其实并没有浪费,应用程序可以调用AWE(通过PAE)来使用这些内存,自己作映射了。

微软承认在某些情况下,4GB只被认出3GB。原因是由于XP或2003在某些主板的行为所致。微软的建议是升级到XP SP2或2003 SP1。 这有的时候并不成功。原因是系统硬件具有内存冗余(redundant memory)或内存镜像(memory mirroring)的功能。只能参考主板的手册,在BIOS中关闭对于的选项。

所以,这可能是主板和OS兼容的问题,打补丁,升级BIOS,调整BIOS中的内存设置,甚至换内存都可能是解决之道。 或者换2003的企业版。



----------------------------------------------------------------------------------

sd9phoenix 发表于:2008-06-15 14:57:55

PAE模式是因32位CPU的寻址局限而出现的,4G以上超出了32bit的寻址范围,
PAE只能在32位的windows系统上使用,64位的windows系统不支持PAE~
所以的确没意义……





欢迎扫码关注:




转载请注明出自 ,如是转载文则注明原出处,谢谢:)
RSS订阅地址: https://www.felix021.com/blog/feed.php
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   *非必须
网址   电邮   [注册]